Unicast communication method and apparatus

ABSTRACT

This application provides a unicast communication method and apparatus. The method includes: A first relay device receives a first message sent by a first terminal device, where the first message includes a first identifier of a second terminal device. The first relay device sends a second message to the second terminal device when transmission quality of the first message meets a first preset condition, where the second message is for establishing a first unicast connection, and the first unicast connection is a unicast connection established between the first terminal device and the second terminal device through the first relay device. According to the unicast communication method provided in this application, an appropriate relay device is selected in a unicast connection establishment process. This helps improve a success rate of the unicast connection and communication quality of unicast communication.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2021/093385, filed on May 12, 2021, which claims priority toChinese Patent Application No. 202010459752.X, filed on May 27, 2020.The disclosures of the aforementioned applications are hereinincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the communication field, and morespecifically, to a unicast communication method and apparatus.

BACKGROUND

In a wireless communication system, data communication may be performedbetween user equipments (UEs) via a network, or communication may bedirectly performed between UEs not through a network device. Aninterface between the UEs is referred to as a PC5 interface, similar toa Uu interface between a UE and a base station. A link between the UEsis referred to as a sidelink (SL). Data transmission is directlyperformed through the sidelink but not via the network. In this way, acommunication delay can be effectively reduced.

The sidelink supports broadcast, unicast, and multicast. Unicastcommunication is similar to data communication performed after a radioresource control (RRC) connection is established between a UE and a basestation, and a unicast connection needs to be first established betweenthe two UEs.

When the UEs communicate with each other through the sidelink, acommunication distance can not very long due to factors such as aninsufficient hardware capability of a transmit-side UE. This limits ascenario in which the UEs communicate with each other through thesidelink. To resolve this problem, a UE-to-UE relay architecture isintroduced into discussions in a standard. Data or signalingtransmission may be performed between two UEs through a relay device (arelay UE).

In an actual application process, there may be a plurality of relay UEsbetween an initiating UE (a UE 1) and a target UE (a UE 2) between whichunicast communication is required. There may be no determinedrelationship between the UE 1, the UE 2, and each of the plurality ofrelay UEs, and not all of the relay UEs are appropriate for both the UE1 and the UE 2 between which the unicast communication is required. In aconventional technology, there is no good method for selecting a relayUE in a process of establishing a unicast connection between the UE 1and the UE 2.

SUMMARY

This application provides a unicast communication method, to helpimprove a success rate of a unicast connection and communication qualityof unicast communication by selecting an appropriate relay device in aunicast connection establishment process.

According to a first aspect, a unicast communication method is provided.The method includes: A first relay device receives a first message sentby a first terminal device, where the first message includes a firstidentifier of a second terminal device. The first relay device sends asecond message to the second terminal device when transmission qualityof the first message meets a first preset condition, where the secondmessage is for establishing a first unicast connection, and the firstunicast connection is a unicast connection established between the firstterminal device and the second terminal device through the first relaydevice.

The first relay device participates in determining the transmissionquality of the first message, so that different cases that exist betweenan initiating UE and the relay device can be considered in a unicastconnection process, to select an appropriate relay device. This improvesa success rate of the unicast connection and quality of unicastcommunication.

With reference to the first aspect, in some implementations of the firstaspect, that transmission quality of the first message meets a firstpreset condition includes: A reference signal received power RSRP of thefirst message is greater than or equal to a first threshold.

Optionally, the first relay device may alternatively perform determiningthe transmission quality of the first message based on an SNR, an SINR,RSRQ, CSI, or the like of the first message.

With reference to the first aspect, in some implementations of the firstaspect, the method further includes: The first relay device receives athird message sent by the second terminal device, where the thirdmessage includes the first identifier of the second terminal device. Thefirst relay device forwards the third message to the first terminaldevice when transmission quality of the third message meets a secondpreset condition.

The relay device performs determining of the transmission quality of thethird message sent by a target UE, so that different cases that existbetween the relay device and the target UE can be considered, and arelay device that is more appropriate for the target UE can be selected.This improves the success rate of the unicast connection and the qualityof the unicast communication.

With reference to the first aspect, in some implementations of the firstaspect, that transmission quality of the third message meets a secondpreset condition includes: An RSRP of the third message is greater thanor equal to a second threshold.

Optionally, the first relay device may alternatively perform determiningthe transmission quality of the third message based on an SNR, an SINR,RSRQ, CSI, or the like of the third message.

With reference to the first aspect, in some implementations of the firstaspect, the method further includes: The first relay device receivesfirst indication information, where the first indication informationindicates the first relay device to change the first preset conditionand/or the second preset condition.

When no appropriate relay device is found after the first message isreceived for the first time, the indication information is received, andthe preset condition is changed, so that a criterion can be changedbased on an actual case, to select the appropriate relay device. Thisensures normal service running.

With reference to the first aspect, in some implementations of the firstaspect, the first message is for requesting to establish the firstunicast connection.

With reference to the first aspect, in some implementations of the firstaspect, the first message is for requesting to discover a target relaydevice.

With reference to the first aspect, in some implementations of the firstaspect, the method further includes: The first relay device receives afourth message sent by the first terminal device, where the fourthmessage is for requesting to establish the first unicast connection. Thefirst relay device forwards the fourth message to the second terminaldevice, where the fourth message is for requesting to establish thefirst unicast connection. The first relay device receives a fifthmessage sent by the second terminal device, where the fifth messageincludes a unicast connection response message. The first relay deviceforwards the fifth message to the first terminal device.

Optionally, the first message may be only for requesting to discover thetarget relay device, or may be further for requesting to establish aunicast connection between the initiating UE and the target UE throughthe target relay device.

With reference to the first aspect, in some implementations of the firstaspect, a unicast connection has been established between the firstrelay device and the second terminal device, and the method furtherincludes: The first relay device receives a sixth message sent by thesecond terminal device, where the sixth message includes a serviceidentifier of the second terminal device. The first relay devicedetermines, based on the service identifier, to send the second messageto the second terminal device.

The relay device may obtain, in advance through the previouslyestablished unicast connection channel, service information of interestto the target UE, to determine, based on the service information,whether to continue to send a message to the target UE. In addition, thepreviously established unicast connection channel may be reused, therebyimproving efficiency of the unicast connection and saving resources.

With reference to the first aspect, in some implementations of the firstaspect, that the first relay device sends a second message to the secondterminal device further includes: The first relay device sends a secondidentifier of the first terminal device when sending the second message,where the second identifier is allocated by the first relay device tothe first terminal device.

A local ID is allocated to the initiating UE, so that the target UE candistinguish between different initiating UEs when reusing a same unicastconnection channel between the relay device and the different initiatingUEs.

With reference to the first aspect, in some implementations of the firstaspect, the method further includes: The first relay device receives aseventh message and the second identifier that are sent by the secondterminal device, where the eighth message includes the first identifierof the first terminal device. Alternatively, the first relay devicereceives second indication information sent by the second terminaldevice, where the second indication information indicates the firstrelay device to release the second identifier of the first terminaldevice.

According to a second aspect, a unicast communication method isprovided. The method includes: A first relay device receives a firstmessage sent by a second terminal device, where the first messageincludes a service identifier of the second terminal device, and aunicast connection has been established between the first relay deviceand the second terminal device. The first relay device determines, basedon the service identifier, to send a second message to the secondterminal device, where the second message is for requesting to establisha first unicast connection, and the first unicast connection is aunicast connection established between a first terminal device and thesecond terminal device through the first relay device.

With reference to the second aspect, in some implementations of thesecond aspect, the method further includes: The first relay devicereceives a third message sent by the first terminal device, where thethird message includes a first identifier of the second terminal device.The first relay device determines, when transmission quality of thethird message meets a first preset condition, to send the second messageto the second terminal device.

With reference to the second aspect, in some implementations of thesecond aspect, that transmission quality of the third message meets afirst preset condition includes: A reference signal received power RSRPof the third message is greater than or equal to a first threshold.

With reference to the second aspect, in some implementations of thesecond aspect, that the first relay device sends the second message tothe second terminal device further includes: The first relay devicesends a second identifier of the first terminal device when sending thesecond message, where the second identifier is allocated by the firstrelay device to the first terminal device.

With reference to the second aspect, in some implementations of thesecond aspect, the method further includes: The first relay devicereceives a fourth message and the second identifier that are sent by thesecond terminal device, where the fourth message includes a firstidentifier of the first terminal device. Alternatively, the first relaydevice receives first indication information sent by the second terminaldevice, where the first indication information indicates the first relaydevice to release the second identifier of the first terminal device.

According to a third aspect, a unicast communication method is provided.The method includes: A first relay device receives a first message sentby a first terminal device, where the first message is for requesting toestablish a second unicast connection, the second unicast connection isa unicast connection established between the first terminal device and athird terminal device through the first relay device, and a unicastconnection has been established between the first relay device and thefirst terminal device. The first relay device sends, to the thirdterminal device, a second message and a corresponding service identifierfor establishing the second unicast connection, where the second messageis for requesting to establish the second unicast connection to thethird terminal device.

Through the previously established unicast connection channel, the relaydevice may not need to perform filtering and determining thetransmission quality of the received first message. In addition, aninitiating UE may reuse, with a plurality of target UEs, the previouslyestablished unicast connection channel between the initiating UE and therelay device, to improve efficiency of the unicast connection and saveresources.

With reference to the third aspect, in some implementations of the thirdaspect, that a first relay device receives a first message sent by afirst terminal device further includes: The first relay device receivesa third identifier of the third terminal device when receiving the firstmessage, where the third identifier is allocated by the first terminaldevice to the third terminal device.

Because the initiating UE may reuse the previously established unicastconnection channel between the initiating UE and the relay device toestablish unicast connections to the plurality of target UEs, theinitiating UE or the relay device allocates local identifiers todifferent target UEs, so that the initiating UE can distinguish betweenthe different target UEs.

With reference to the third aspect, in some implementations of the thirdaspect, the method further includes: The first relay device receives athird message sent by the third terminal device, where the third messageincludes a response message for a second unicast connection request. Thefirst relay device determines whether transmission quality of the thirdmessage meets a third preset condition.

The relay device performs determining of the transmission quality of thethird message sent by a target UE, so that different cases that existbetween the relay device and the target UE can be considered, and arelay device that is more appropriate for the target UE can be selected.This improves a success rate of the unicast connection and quality ofunicast communication.

With reference to the third aspect, in some implementations of the thirdaspect, that transmission quality of the third message meets a thirdpreset condition includes: An RSRP of the third message is greater thanor equal to a third threshold.

Optionally, the first relay device may alternatively perform determiningthe transmission quality of the third message based on an SNR, an SINR,RSRQ, CSI, or the like of the third message.

With reference to the third aspect, in some implementations of the thirdaspect, when the transmission quality of the third message meets thethird preset condition, the method further includes: The first relaydevice sends a fourth message and a fourth identifier of the thirdterminal device to the first terminal device, where the fourth messageincludes a first identifier of a second terminal device, and the fourthidentifier is allocated by the first relay device to the third terminaldevice.

With reference to the third aspect, in some implementations of the thirdaspect, when the transmission quality of the third message does not meetthe third preset condition, the method further includes: The first relaydevice sends third indication information to the first terminal device,where the third indication information indicates that the first relaydevice cannot be configured to establish the second unicast connection.

According to a fourth aspect, a unicast communication method isprovided. The method includes: A second terminal device receives a firstmessage sent by at least one candidate relay device, where the firstmessage includes a first identifier of the second terminal device. Thesecond terminal device sends, when transmission quality of the firstmessage meets a first preset condition, a second message to at least onecandidate relay device that meets the first preset condition, where thesecond message is for establishing a first unicast connection, the firstunicast connection is a unicast connection established between a firstterminal device and the second terminal device through a first relaydevice, and the first relay device is one of the at least one candidaterelay device. Alternatively, when transmission quality of the firstmessage does not meet a first preset condition, the second terminaldevice discards the first message or makes no response.

A target UE performs determining the transmission quality of the firstmessage sent by the relay device, to consider different cases that existbetween the target UE and the relay device, so that an appropriate relaydevice can be selected in a unicast connection process. This improves asuccess rate of the unicast connection and communication quality ofunicast communication.

With reference to the fourth aspect, in some implementations of thethird aspect, that transmission quality of the first message meets afirst preset condition includes: A reference signal received power RSRPof the first message is greater than or equal to a first threshold.

Optionally, the target UE may alternatively perform determining thetransmission quality of the first message based on an SNR, an SINR,RSRQ, CSI, or the like of the first message.

With reference to the fourth aspect, in some implementations of thefourth aspect, the first message further includes a transmission qualityresult of a third message, and the third message is sent by the firstterminal device to the at least one candidate relay device. Thattransmission quality of the first message meets a first preset conditionfurther includes: A reference signal received power RSRP of the thirdmessage is greater than or equal to a second threshold.

Optionally, the relay device may only measure but does not performfiltering on the transmission quality of the first message, and send ameasurement result to the target UE, so that the target UE can performcomprehensive determining of the transmission quality of the firstmessage and the second message, to select the appropriate relay deviceto establish the unicast connection. This helps improve the success rateof the unicast connection.

With reference to the fourth aspect, in some implementations of thefourth aspect, that the second terminal device sends, when transmissionquality of the first message meets a first preset condition, a secondmessage to at least one candidate relay device that meets the firstpreset condition further includes: The second terminal device selectsthe first relay device from the at least one candidate relay devicebased on a second preset condition. The second terminal device sends thesecond message to the first relay device.

Optionally, the target UE may select, from the plurality of candidaterelay devices based on the preset condition, an optimal relay devicethat meets the condition or a plurality of relay devices that meet thecondition.

With reference to the fourth aspect, in some implementations of thefourth aspect, the method further includes: The second terminal devicereceives first indication information, where the first indicationinformation indicates the second terminal device to change the firstpreset condition and/or the second preset condition.

When no appropriate relay device is found after the first message isreceived for the first time, the indication information is received, andthe preset condition is changed, so that a criterion can be changedbased on an actual case, to select the appropriate relay device. Thisensures normal service running.

With reference to the fourth aspect, in some implementations of thefourth aspect, the first message is for requesting to establish thefirst unicast connection.

With reference to the fourth aspect, in some implementations of thefourth aspect, the first message is for requesting to discover a targetrelay device.

Optionally, the first message may be only for requesting to discover thetarget relay device, or may be further for requesting to establish aunicast connection between an initiating UE and the target UE throughthe relay device.

With reference to the fourth aspect, in some implementations of thefourth aspect, the method further includes: The second terminal devicereceives a fourth message sent by the first relay device, where thefourth message is for requesting to establish the first unicastconnection. The second terminal device sends a fifth message to thefirst relay device, where the fifth message includes a unicastconnection response message.

With reference to the fourth aspect, in some implementations of thefourth aspect, a unicast connection has been established between thesecond terminal device and the at least one candidate relay device, andthe method further includes: The second terminal device sends a sixthmessage to the at least one candidate relay device, where the sixthmessage includes a service identifier of the second terminal device.

The target UE may send, to the relay device in advance through thepreviously established unicast connection channel, service informationof interest to the target UE, so that the relay device can determine,based on the service information, whether to continue to send a messageto the target UE. In addition, the previously established unicastconnection channel may be reused, thereby improving efficiency of theunicast connection and saving resources.

With reference to the fourth aspect, in some implementations of thefourth aspect, that a second terminal device receives a first messagesent by at least one candidate relay device further includes: The secondterminal device receives a second identifier of the first terminaldevice when receiving the first message, where the second identifier isallocated by the at least one candidate relay device to the firstterminal device.

A local ID allocated by the relay device to the initiating UE isreceived, so that the target UE can distinguish between differentinitiating UEs when reusing a same unicast connection channel betweenthe relay device and the target UE.

With reference to the fourth aspect, in some implementations of thefourth aspect, that the second terminal device sends a second message toat least one candidate relay device that meets the first presetcondition further includes: The second terminal device sends a secondidentifier of the second terminal device when sending the secondmessage.

Optionally, when the transmission quality of the first message meets thefirst preset condition, the second terminal device may send secondindication information to the at least one candidate relay device thatmeets the first preset condition, where the second indicationinformation indicates the at least one candidate relay device to releasea second identifier, the second identifier is allocated by the firstrelay device to the first terminal device, and unicast communicationneeds to be performed between the first terminal device and the secondterminal device.

According to a fifth aspect, a unicast communication method is provided.The method includes: A second terminal device sends a first message toat least one candidate relay device, where the first message includes aservice identifier of the second terminal device, and a unicastconnection has been established between the second terminal device andthe at least one candidate relay device.

With reference to the fifth aspect, in some implementations of the fifthaspect, the method further includes: The second terminal device receivesa second message sent by the at least one candidate relay device, wherethe second message is for requesting to establish a first unicastconnection, the first unicast connection is a unicast connectionestablished between a first terminal device and the second terminaldevice through a first relay device, and the first relay device is oneof the at least one candidate relay device. The second terminal devicesends a third message to the at least one candidate relay device.Alternatively, when transmission quality of the second message meets afirst preset condition, the second terminal device sends a third messageto at least one candidate relay device that meets the first presetcondition, where the third message includes a unicast connectionresponse message. Alternatively, when transmission quality of the secondmessage does not meet a first preset condition, the second terminaldevice discards the second message or makes no response.

With reference to the fifth aspect, in some implementations of the fifthaspect, that transmission quality of the second message meets a firstpreset condition includes: A reference signal received power RSRP of thesecond message is greater than or equal to a first threshold.

With reference to the fifth aspect, in some implementations of the fifthaspect, the second message further includes a transmission qualityresult of a fourth message, and the fourth message is sent by the firstterminal device to the at least one candidate relay device. Thattransmission quality of the second message meets a first presetcondition further includes: A reference signal received power RSRP ofthe fourth message is greater than or equal to a second threshold.

With reference to the fifth aspect, in some implementations of the fifthaspect, that the second terminal device sends, when transmission qualityof the second message meets a first preset condition, a third message toat least one candidate relay device that meets the first presetcondition further includes: The second terminal device selects the firstrelay device from the at least one candidate relay device based on asecond preset condition. The second terminal device sends the thirdmessage to the first relay device.

With reference to the fifth aspect, in some implementations of the fifthaspect, the method further includes: The second terminal device receivesfirst indication information, where the first indication informationindicates the second terminal device to change the first presetcondition and/or the second preset condition.

With reference to the fifth aspect, in some implementations of the fifthaspect, that the second terminal device receives a second message sentby the at least one candidate relay device further includes: The secondterminal device receives a second identifier of the first terminaldevice when receiving the second message, where the second identifier isallocated by the at least one candidate relay device to the firstterminal device.

With reference to the fifth aspect, in some implementations of the fifthaspect, that the second terminal device sends a third message to the atleast one candidate relay device further includes: The second terminaldevice sends a second identifier of the first terminal device whensending the third message.

Optionally, the second terminal device may further send secondindication information to the at least one candidate relay device, wherethe second indication information indicates the at least one candidaterelay device to release the second identifier.

According to a sixth aspect, a unicast communication method is provided.The method includes: A first terminal device sends a first message to atleast one candidate relay device, where the first message includes afirst identifier of a second terminal device. The first terminal devicereceives a second message sent by the at least one candidate relaydevice, where the second message includes the first identifier of thesecond terminal device. The first terminal device sends a third messageto a first relay device when transmission quality of the second messagemeets a first preset condition, where the third message is forestablishing a first unicast connection, the first unicast connection isa unicast connection established between the first terminal device andthe second terminal device through the first relay device, and the firstrelay device is one of the at least one candidate relay device.

An initiating UE performs determining the transmission quality of thereceived second message, so that different cases that exist between theinitiating UE and the relay device can be considered, to select anappropriate relay device in a unicast connection process. This improvesa success rate of the unicast connection and communication quality ofunicast communication.

With reference to the sixth aspect, in some implementations of the sixthaspect, that transmission quality of the second message meets a firstpreset condition includes: A reference signal received power RSRP of thesecond message is greater than or equal to a first threshold.

Optionally, the initiating UE may alternatively perform determining thetransmission quality of the second message based on an SNR, an SINR,RSRQ, CSI, or the like of the second message.

With reference to the sixth aspect, in some implementations of the sixthaspect, the first message is for requesting to establish the firstunicast connection, the third message includes first indicationinformation, and the first indication message indicates the secondterminal device to establish the first unicast connection to the firstterminal device through the first relay device.

With reference to the sixth aspect, in some implementations of the sixthaspect, the first message is for requesting to discover a target relaydevice, and the third message is for requesting to establish the firstunicast connection to the second terminal device through the first relaydevice.

Optionally, the first message may be only for discovering the targetrelay device, or may be further for requesting to establish a unicastconnection between the initiating UE and a target UE through the relaydevice.

According to a seventh aspect, a unicast communication method isprovided. The method includes: A first terminal device sends a firstmessage to at least one candidate relay device, where the first messageis for requesting to establish a second unicast connection, the firstmessage includes information about a corresponding service identifierfor establishing the second unicast connection, a unicast connection hasbeen established between the at least one candidate relay device and thefirst terminal device, the second unicast connection is a unicastconnection established between the first terminal device and a thirdterminal device through a first relay device, and the first relay deviceis one of the at least one candidate relay device.

Through the previously established unicast connection channel, aninitiating UE may reuse, with a plurality of target UEs, the previouslyestablished unicast connection channel between the initiating UE and therelay device, to improve efficiency of the unicast connection and saveresources.

With reference to the seventh aspect, in some implementations of theseventh aspect, the method further includes: The first terminal devicereceives a second message and a second identifier of a second terminaldevice that are sent by the first relay device, or receives secondindication information sent by the first relay device, where the secondidentifier of the second terminal device is allocated by the first relaydevice or the first terminal device to the second terminal device, andthe second indication information indicates that the first relay devicecannot be configured to establish the unicast connection.

Because the initiating UE may reuse the previously established unicastconnection channel between the initiating UE and the relay device toestablish unicast connections to the plurality of target UEs, theinitiating UE can distinguish between different target UEs based onlocal identifiers allocated by the initiating UE or the relay device tothe different target UEs.

With reference to the seventh aspect, in some implementations of theseventh aspect, that a first terminal device sends a first message to atleast one candidate relay device further includes: The first terminaldevice sends a third identifier of the third terminal device whensending the first message, where the third identifier is allocated bythe first terminal device to the third terminal device.

Because the initiating UE may reuse the previously established unicastconnection channel between the initiating UE and the relay device toestablish the unicast connections to the plurality of target UEs, theinitiating UE may allocate the local identifiers to the different targetUEs, so that the initiating UE can distinguish between the differenttarget UEs.

With reference to the seventh aspect, in some implementations of theseventh aspect, the method further includes: The first terminal devicesends second indication information, where the second indicationinformation indicates the first relay device and the second terminaldevice to change a preset condition.

When no appropriate relay device is found after the first message issent for the first time, the indication information is sent to changethe preset condition, so that a criterion can be changed based on anactual case, to select an appropriate relay device. This ensures normalservice running.

According to an eighth aspect, a unicast communication apparatus isprovided. The apparatus includes: a first receiving module, configuredto receive a first message sent by a first terminal device, where thefirst message includes a first identifier of a second terminal device; afirst processing module, configured to determine that transmissionquality of the first message meets a first preset condition; and a firstsending module, configured to send, by a first relay device, a secondmessage to the second terminal device when the transmission quality ofthe first message meets the first preset condition, where the secondmessage is for establishing a first unicast connection, and the firstunicast connection is a unicast connection established between the firstterminal device and the second terminal device through the first relaydevice.

With reference to the eighth aspect, in some implementations of theeighth aspect, the first processing module is specifically configured todetermine that a reference signal received power RSRP of the firstmessage is greater than or equal to a first threshold.

With reference to the eighth aspect, in some implementations of theeighth aspect, the first receiving module is further configured toreceive a third message sent by the second terminal device, where thethird message includes the first identifier of the second terminaldevice. The first processing module is further configured to determinethat transmission quality of the third message meets a second presetcondition. The first sending module is further configured to forward thethird message to the first terminal device when the transmission qualityof the third message meets the second preset condition.

With reference to the eighth aspect, in some implementations of theeighth aspect, the first processing module is specifically configured todetermine that an RSRP of the third message is greater than or equal toa second threshold.

With reference to the eighth aspect, in some implementations of theeighth aspect, the first receiving module is further configured toreceive first indication information, where the first indicationinformation indicates the apparatus to change the first preset conditionand/or the second preset condition.

With reference to the eighth aspect, in some implementations of theeighth aspect, the first message is for requesting to establish thefirst unicast connection.

With reference to the eighth aspect, in some implementations of theeighth aspect, the first message is for requesting to discover a targetrelay device.

With reference to the eighth aspect, in some implementations of theeighth aspect, the first receiving module is further configured toreceive a fourth message sent by the first terminal device, where thefourth message is for requesting to establish the first unicastconnection. The first sending module is further configured to forwardthe fourth message to the second terminal device. The first receivingmodule is further configured to receive a fifth message sent by thesecond terminal device, where the fifth message includes a unicastconnection response message. The first sending module is furtherconfigured to forward the fifth message to the first terminal device.

With reference to the eighth aspect, in some implementations of theeighth aspect, a unicast connection has been established between thefirst relay device and the second terminal device. The first receivingmodule is further configured to receive a sixth message sent by thesecond terminal device, where the sixth message includes a serviceidentifier of the second terminal device. The first processing module isfurther configured to determine, based on the service identifier, tosend the second message to the second terminal device.

With reference to the eighth aspect, in some implementations of theeighth aspect, a second sending module is further configured to send asecond identifier of the first terminal device when sending the secondmessage, where the second identifier is allocated by the apparatus tothe first terminal device.

With reference to the eighth aspect, in some implementations of theeighth aspect, the first receiving module is further configured to:receive a seventh message and the second identifier that are sent by thesecond terminal device, where the seventh message includes the firstidentifier of the second terminal device; or receive second indicationinformation sent by the second terminal device, where the secondindication information indicates the apparatus to release the secondidentifier of the first terminal device.

According to a ninth aspect, a unicast communication apparatus isprovided. The apparatus includes: a sixth receiving module, configuredto receive a first message sent by a second terminal device, where thefirst message includes a service identifier of the second terminaldevice, and a unicast connection has been established between a firstrelay device and the second terminal device; and a sixth sending module,configured to determine, based on the service identifier, to send asecond message to the second terminal device, where the second messageis for requesting to establish a first unicast connection, and the firstunicast connection is a unicast connection established between a firstterminal device and the second terminal device through the first relaydevice.

With reference to the ninth aspect, in some implementations of the ninthaspect, the sixth receiving module is further configured to receive athird message sent by the first terminal device, where the third messageincludes a first identifier of the second terminal device. The apparatusfurther includes a sixth processing module, configured to determine thattransmission quality of the third message meets a first presetcondition. The sixth sending module is further configured to determine,by the first relay device when the transmission quality of the thirdmessage meets the first preset condition, to send the second message tothe second terminal device.

With reference to the ninth aspect, in some implementations of the ninthaspect, the sixth processing module is specifically configured todetermine that a reference signal received power RSRP of the thirdmessage is greater than or equal to a first threshold.

With reference to the ninth aspect, in some implementations of the ninthaspect, the sixth sending module is further configured to send a secondidentifier of the first terminal device when sending the second message,where the second identifier is allocated by the apparatus to the firstterminal device.

With reference to the ninth aspect, in some implementations of the ninthaspect, the sixth receiving module is further configured to: receive afourth message and the second identifier that are sent by the secondterminal device, where the fourth message includes a first identifier ofthe first terminal device; or receive first indication information sentby the second terminal device, where the first indication informationindicates the apparatus to release the second identifier of the firstterminal device.

According to a tenth aspect, a unicast communication apparatus isprovided. The apparatus includes: a second receiving module, configuredto receive a first message sent by a first terminal device, where thefirst message is for requesting to establish a second unicastconnection, the second unicast connection is a unicast connectionestablished between the first terminal device and a third terminaldevice through the apparatus, and a unicast connection has beenestablished between the apparatus and the first terminal device; and asecond sending module, configured to send, to the third terminal device,a second message and a corresponding service identifier for establishingthe second unicast connection, where the second message is forrequesting to establish the second unicast connection to the thirdterminal device.

With reference to the tenth aspect, in some implementations of the tenthaspect, the second receiving module is specifically configured toreceive a third identifier of the third terminal device when receivingthe first message, where the third identifier is allocated by the firstterminal device to the third terminal device.

With reference to the tenth aspect, in some implementations of the tenthaspect, the second receiving module is further configured to receive athird message sent by the third terminal device, where the third messageincludes a response message for a second unicast connection request. Theapparatus further includes a second processing module, configured todetermine whether transmission quality of the third message meets athird preset condition.

With reference to the tenth aspect, in some implementations of the tenthaspect, the second processing module is specifically configured todetermine that an RSRP of the third message is greater than or equal toa third threshold.

With reference to the tenth aspect, in some implementations of the tenthaspect, the second sending module is further configured to send a fourthmessage and a fourth identifier of the third terminal device to thefirst terminal device, where the fourth message includes a firstidentifier of a second terminal device, and the fourth identifier isallocated by the first relay device to the third terminal device.

With reference to the tenth aspect, in some implementations of the tenthaspect, the second sending module is further configured to send thirdindication information to the first terminal device, where the thirdindication information indicates that the apparatus cannot be configuredto establish the second unicast connection.

According to an eleventh aspect, a unicast communication apparatus isprovided. The apparatus includes: a third receiving module, configuredto receive a first message sent by at least one candidate relay device,where the first message includes a first identifier of the apparatus; athird processing module, configured to determine whether transmissionquality of the first message meets a first preset condition; and a thirdsending module, configured to: when the transmission quality of thefirst message meets the first preset condition, send a second message toat least one candidate relay device that meets the first presetcondition, where the second message is for establishing a first unicastconnection, the first unicast connection is a unicast connectionestablished between a first terminal device and the apparatus through afirst relay device, and the first relay device is one of the at leastone candidate relay device; or when the transmission quality of thefirst message does not meet the first preset condition, discard thefirst message or make no response.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the third processing module is specifically configuredto determine that a reference signal received power RSRP of the firstmessage is greater than or equal to a first threshold.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the first message further includes a transmissionquality result of a third message, and the third message is sent by thefirst terminal device to the at least one candidate relay device. Thethird processing module is further configured to determine that areference signal received power RSRP of the third message is greaterthan or equal to a second threshold.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the third processing module is further configured toselect the first relay device from the at least one candidate relaydevice based on a second preset condition. The third sending module isfurther configured to send the second message to the first relay device.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the third receiving module is further configured toreceive first indication information, where the first indicationinformation indicates the apparatus to change the first preset conditionand/or the second preset condition.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the first message is for requesting to establish thefirst unicast connection.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the first message is for requesting to discover atarget relay device.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the third receiving module is further configured toreceive a fourth message sent by the first relay device, where thefourth message is for requesting to establish the first unicastconnection. The third sending module is further configured to send afifth message to the first relay device, where the fifth messageincludes a unicast connection response message.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, a unicast connection has been established between thesecond terminal device and the at least one candidate relay device. Thethird sending module is further configured to send a sixth message tothe at least one candidate relay device, where the sixth messageincludes a service identifier of the apparatus.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the third receiving module is further configured toreceive a second identifier of the first terminal device when receivingthe first message, where the second identifier is allocated by the atleast one candidate relay device to the first terminal device.

With reference to the eleventh aspect, in some implementations of theeleventh aspect, the third sending module is further configured to senda second identifier of the first terminal device when sending the secondmessage.

According to a twelfth aspect, a unicast communication apparatus isprovided. The apparatus includes: a seventh processing module,configured to generate a first message, where the first message includesa service identifier of the apparatus; and a seventh sending module,configured to send the first message to at least one candidate relaydevice, where a unicast connection has been established between theapparatus and the at least one candidate relay device.

With reference to the twelfth aspect, in some implementations of thetwelfth aspect, the apparatus further includes a seventh receivingmodule, configured to receive a second message sent by the at least onecandidate relay device, where the second message is for requesting toestablish a first unicast connection, the first unicast connection is aunicast connection established between a first terminal device and theapparatus through a first relay device, and the first relay device isone of the at least one candidate relay device. The seventh sendingmodule is further configured to send a third message to the at least onecandidate relay device. Alternatively, the seventh processing module isfurther configured to determine whether transmission quality of thesecond message meets a first preset condition. When the transmissionquality of the second message meets the first preset condition, theseventh sending module is further configured to send a third message toat least one candidate relay device that meets the first presetcondition, where the third message includes a unicast connectionresponse message. Alternatively, when the transmission quality of thesecond message does not meet the first preset condition, the apparatusdiscards the second message or makes no response.

With reference to the twelfth aspect, in some implementations of thetwelfth aspect, the seventh processing module is specifically configuredto determine that a reference signal received power RSRP of the secondmessage is greater than or equal to a first threshold.

With reference to the twelfth aspect, in some implementations of thetwelfth aspect, the second message further includes a transmissionquality result of a fourth message, and the fourth message is sent bythe first terminal device to the at least one candidate relay device.The seventh processing module is further configured to determine that areference signal received power RSRP of the fourth message is greaterthan or equal to a second threshold.

With reference to the twelfth aspect, in some implementations of thetwelfth aspect, the seventh processing module is further configured toselect the first relay device from the at least one candidate relaydevice based on a second preset condition. The seventh sending module isfurther configured to send the third message to the first relay device.

With reference to the twelfth aspect, in some implementations of thetwelfth aspect, the seventh receiving module is further configured toreceive first indication information, where the first indicationinformation indicates the apparatus to change the first preset conditionand/or the second preset condition.

With reference to the twelfth aspect, in some implementations of thetwelfth aspect, the seventh receiving module is further configured toreceive a second identifier of the first terminal device when receivingthe second message, where the second identifier is allocated by the atleast one candidate relay device to the first terminal device.

With reference to the twelfth aspect, in some implementations of thetwelfth aspect, the seventh sending module is further configured to senda second identifier of the first terminal device when sending the thirdmessage.

Optionally, the seventh sending module may be further configured to sendsecond indication information to the at least one candidate relaydevice, where the second indication information indicates the at leastone candidate relay device to release the second identifier.

According to a thirteenth aspect, a unicast communication apparatus isprovided. The apparatus includes: a fourth sending module, configured tosend a first message to at least one candidate relay device, where thefirst message includes a first identifier of a second terminal device; afourth receiving module, configured to receive a second message sent bythe at least one candidate relay device, where the second messageincludes the first identifier of the second terminal device; and afourth processing module, configured to determine that transmissionquality of the second message meets a first preset condition. The fourthsending module is further configured to send a third message to a firstrelay device when the transmission quality of the second message meetsthe first preset condition, where the third message is for establishinga first unicast connection, the first unicast connection is a unicastconnection established between the apparatus and the second terminaldevice through the first relay device, and the first relay device is oneof the at least one candidate relay device.

With reference to the thirteenth aspect, in some implementations of thethirteenth aspect, the fourth processing module is specificallyconfigured to determine that a reference signal received power RSRP ofthe second message is greater than or equal to a first threshold.

With reference to the thirteenth aspect, in some implementations of thethirteenth aspect, the first message is for requesting to establish thefirst unicast connection, the third message includes first indicationinformation, and the first indication message indicates the secondterminal device to establish the first unicast connection to theapparatus through the first relay device.

With reference to the thirteenth aspect, in some implementations of thethirteenth aspect, the first message is for requesting to discover atarget relay device, and the third message is for requesting toestablish the first unicast connection to the second terminal devicethrough the first relay device.

According to a fourteenth aspect, a unicast communication apparatus isprovided. The apparatus includes: a fifth processing module, configuredto generate a first message, where the first message is for requestingto establish a second unicast connection, the first message includesinformation about a corresponding service identifier for establishingthe second unicast connection, a unicast connection has been establishedbetween the apparatus and at least one candidate relay device, thesecond unicast connection is a unicast connection established betweenthe apparatus and a third terminal device through a first relay device,and the first relay device is one of the at least one candidate relaydevice; and a fifth sending module, configured to send the first messageto the at least one candidate relay device.

With reference to the fourteenth aspect, in some implementations of thefourteenth aspect, the apparatus further includes a fifth receivingmodule, configured to: receive a second message and a second identifierof a second terminal device that are sent by the first relay device, orreceive second indication information sent by the first relay device,where the second identifier of the second terminal device is allocatedby the first relay device or the apparatus to the second terminaldevice, and the second indication information indicates that the firstrelay device cannot be configured to establish the unicast connection.

With reference to the fourteenth aspect, in some implementations of thefourteenth aspect, the fifth sending module is further configured tosend a third identifier of the third terminal device when sending thefirst message, where the third identifier is allocated by the apparatusto the third terminal device.

With reference to the fourteenth aspect, in some implementations of thefourteenth aspect, the fifth sending module is further configured tosend second indication information, where the second indicationinformation indicates the first relay device and the second terminaldevice to change a preset condition.

According to a fifteenth aspect, a communication apparatus is provided.The communication apparatus has a function of implementing the methodaccording to the first aspect. The function may be implemented byhardware, or may be implemented by hardware executing correspondingsoftware. The hardware or the software includes one or more modulescorresponding to the foregoing function.

According to a sixteenth aspect, a communication apparatus is provided.The communication apparatus has a function of implementing the methodaccording to the second aspect. The function may be implemented byhardware, or may be implemented by hardware executing correspondingsoftware. The hardware or the software includes one or more modulescorresponding to the foregoing function.

According to a seventeenth aspect, a communication apparatus isprovided. The communication apparatus has a function of implementing themethod according to the third aspect. The function may be implemented byhardware, or may be implemented by hardware executing correspondingsoftware. The hardware or the software includes one or more modulescorresponding to the foregoing function.

According to an eighteenth aspect, a communication apparatus isprovided. The communication apparatus has a function of implementing themethod according to the fourth aspect. The function may be implementedby hardware, or may be implemented by hardware executing correspondingsoftware. The hardware or the software includes one or more modulescorresponding to the foregoing function.

According to a nineteenth aspect, a communication apparatus is provided.The communication apparatus has a function of implementing the methodaccording to the fifth aspect. The function may be implemented byhardware, or may be implemented by hardware executing correspondingsoftware. The hardware or the software includes one or more modulescorresponding to the foregoing function.

According to a twentieth aspect, a communication apparatus is provided.The communication apparatus has a function of implementing the methodaccording to the sixth aspect. The function may be implemented byhardware, or may be implemented by hardware executing correspondingsoftware. The hardware or the software includes one or more modulescorresponding to the foregoing function.

According to a twenty-first aspect, a communication apparatus isprovided. The communication apparatus has a function of implementing themethod according to the seventh aspect. The function may be implementedby hardware, or may be implemented by hardware executing correspondingsoftware. The hardware or the software includes one or more modulescorresponding to the foregoing function.

According to a twenty-second aspect, a communication apparatus isprovided. The communication apparatus includes a processor and a memory.The memory is configured to store a computer program, and the processoris configured to invoke the computer program from the memory and run thecomputer program, so that the communication device performs the methodaccording to the first aspect and the possible implementations of thefirst aspect.

According to a twenty-third aspect, a communication apparatus isprovided. The communication apparatus includes a processor and a memory.The memory is configured to store a computer program, and the processoris configured to invoke the computer program from the memory and run thecomputer program, so that the communication device performs the methodaccording to the second aspect and the possible implementations of thesecond aspect.

According to a twenty-fourth aspect, a communication apparatus isprovided. The communication apparatus includes a processor and a memory.The memory is configured to store a computer program, and the processoris configured to invoke the computer program from the memory and run thecomputer program, so that the communication device performs the methodaccording to the third aspect and the possible implementations of thethird aspect.

According to a twenty-fifth aspect, a communication apparatus isprovided. The communication apparatus includes a processor and a memory.The memory is configured to store a computer program, and the processoris configured to invoke the computer program from the memory and run thecomputer program, so that the communication device performs the methodaccording to the fourth aspect and the possible implementations of thefourth aspect.

According to a twenty-sixth aspect, a communication apparatus isprovided. The communication apparatus includes a processor and a memory.The memory is configured to store a computer program, and the processoris configured to invoke the computer program from the memory and run thecomputer program, so that the communication device performs the methodaccording to the fifth aspect and the possible implementations of thefifth aspect.

According to a twenty-seventh aspect, a communication apparatus isprovided. The communication apparatus includes a processor and a memory.The memory is configured to store a computer program, and the processoris configured to invoke the computer program from the memory and run thecomputer program, so that the communication device performs the methodaccording to the sixth aspect and the possible implementations of thesixth aspect.

According to a twenty-eighth aspect, a communication apparatus isprovided. The communication apparatus includes a processor and a memory.The memory is configured to store a computer program, and the processoris configured to invoke the computer program from the memory and run thecomputer program, so that the communication device performs the methodaccording to the seventh aspect and the possible implementations of theseventh aspect.

According to a twenty-ninth aspect, an apparatus (where for example, theapparatus may be a chip system) is provided. The apparatus includes aprocessor, configured to support the communication apparatus inimplementing the functions in the first aspect. In a possible design,the apparatus further includes a memory, and the memory is configured tostore program instructions and data necessary for the communicationapparatus. When the apparatus is the chip system, the apparatus mayinclude a chip, or may include a chip and another discrete component.

According to a thirtieth aspect, an apparatus (where for example, theapparatus may be a chip system) is provided. The apparatus includes aprocessor, configured to support the communication apparatus inimplementing the functions in the second aspect. In a possible design,the apparatus further includes a memory, and the memory is configured tostore program instructions and data necessary for the communicationapparatus. When the apparatus is the chip system, the apparatus mayinclude a chip, or may include a chip and another discrete component.

According to a thirty-first aspect, an apparatus (where for example, theapparatus may be a chip system) is provided. The apparatus includes aprocessor, configured to support the communication apparatus inimplementing the functions in the third aspect. In a possible design,the apparatus further includes a memory, and the memory is configured tostore program instructions and data necessary for the communicationapparatus. When the apparatus is the chip system, the apparatus mayinclude a chip, or may include a chip and another discrete component.

According to a thirty-second aspect, an apparatus (where for example,the apparatus may be a chip system) is provided. The apparatus includesa processor, configured to support the communication apparatus inimplementing the functions in the fourth aspect. In a possible design,the apparatus further includes a memory, and the memory is configured tostore program instructions and data necessary for the communicationapparatus. When the apparatus is the chip system, the apparatus mayinclude a chip, or may include a chip and another discrete component.

According to a thirty-third aspect, an apparatus (where for example, theapparatus may be a chip system) is provided. The apparatus includes aprocessor, configured to support the communication apparatus inimplementing the functions in the fifth aspect. In a possible design,the apparatus further includes a memory, and the memory is configured tostore program instructions and data necessary for the communicationapparatus. When the apparatus is the chip system, the apparatus mayinclude a chip, or may include a chip and another discrete component.

According to a thirty-fourth aspect, an apparatus (where for example,the apparatus may be a chip system) is provided. The apparatus includesa processor, configured to support the communication apparatus inimplementing the functions in the sixth aspect. In a possible design,the apparatus further includes a memory, and the memory is configured tostore program instructions and data necessary for the communicationapparatus. When the apparatus is the chip system, the apparatus mayinclude a chip, or may include a chip and another discrete component.

According to a thirty-fifth aspect, an apparatus (where for example, theapparatus may be a chip system) is provided. The apparatus includes aprocessor, configured to support the communication apparatus inimplementing the functions in the seventh aspect. In a possible design,the apparatus further includes a memory, and the memory is configured tostore program instructions and data necessary for the communicationapparatus. When the apparatus is the chip system, the apparatus mayinclude a chip, or may include a chip and another discrete component.

According to a thirty-sixth aspect, a computer-readable storage mediumis provided. The computer-readable storage medium is configured to storea computer program. The computer program includes instructions forperforming the method according to any one of the first aspect or thepossible implementations of the first aspect.

According to a thirty-seventh aspect, a computer-readable storage mediumis provided. The computer-readable storage medium is configured to storea computer program. The computer program includes instructions forperforming the method according to any one of the second aspect or thepossible implementations of the second aspect.

According to a thirty-eighth aspect, a computer-readable storage mediumis provided. The computer-readable storage medium is configured to storea computer program. The computer program includes instructions forperforming the method according to any one of the fourth aspect or thepossible implementations of the fourth aspect.

According to a thirty-ninth aspect, a computer-readable storage mediumis provided. The computer-readable storage medium is configured to storea computer program. The computer program includes instructions forperforming the method according to any one of the first aspect or thepossible implementations of the first aspect.

According to a fortieth aspect, a computer-readable storage medium isprovided. The computer-readable storage medium is configured to store acomputer program. The computer program includes instructions forperforming the method according to any one of the fifth aspect or thepossible implementations of the fifth aspect.

According to a forty-first aspect, a computer-readable storage medium isprovided. The computer-readable storage medium is configured to store acomputer program. The computer program includes instructions forperforming the method according to any one of the sixth aspect or thepossible implementations of the sixth aspect.

According to a forty-second aspect, a computer-readable storage mediumis provided. The computer-readable storage medium is configured to storea computer program. The computer program includes instructions forperforming the method according to any one of the seventh aspect or thepossible implementations of the seventh aspect.

According to a forty-third aspect, a computer program product isprovided. The computer program product includes a computer program. Whenthe computer program is run on a computer device, the computer device isenabled to perform the method according to the first aspect.

According to a forty-fourth aspect, a computer program product isprovided. The computer program product includes a computer program. Whenthe computer program is run on a computer device, the computer device isenabled to perform the method according to the second aspect.

According to a forty-fifth aspect, a computer program product isprovided. The computer program product includes a computer program. Whenthe computer program is run on a computer device, the computer device isenabled to perform the method according to the third aspect.

According to a forty-sixth aspect, a computer program product isprovided. The computer program product includes a computer program. Whenthe computer program is run on a computer device, the computer device isenabled to perform the method according to the fourth aspect.

According to a forty-seventh aspect, a computer program product isprovided. The computer program product includes a computer program. Whenthe computer program is run on a computer device, the computer device isenabled to perform the method according to the fifth aspect.

According to a forty-eighth aspect, a computer program product isprovided. The computer program product includes a computer program. Whenthe computer program is run on a computer device, the computer device isenabled to perform the method according to the sixth aspect.

According to a forty-ninth aspect, a computer program product isprovided. The computer program product includes a computer program. Whenthe computer program is run on a computer device, the computer device isenabled to perform the method according to the seventh aspect.

According to a fiftieth aspect, a communication system is provided. Thecommunication system includes a first terminal device, a second terminaldevice, at least one candidate relay device, and a first relay device.The first relay device is configured to perform a step performed by thefirst relay device in the first aspect, the second aspect, and/or thethird aspect or in the solutions provided in embodiments of thisapplication. The second terminal device is configured to perform a stepperformed by the second terminal device in the fourth aspect and/or thefifth aspect or in the solutions provided in embodiments of thisapplication. The first terminal device is configured to perform a stepperformed by the first terminal device in the sixth aspect and/or theseventh aspect or in the solutions provided in embodiments of thisapplication. Optionally, the communication system further includes athird terminal device, where the third network device is configured toperform a step performed by the third terminal device in the thirdaspect and/or the seventh aspect or in the solutions provided inembodiments of this application.

These aspects or other aspects of this application are clearer and morecomprehensible in descriptions of the following embodiments.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a system architecture according to anembodiment of this application;

FIG. 2 is a schematic flowchart of a unicast connection;

FIG. 3 is a schematic diagram of UE-UE data transmission according to anembodiment of this application;

FIG. 4 is another schematic diagram of UE-UE data transmission accordingto an embodiment of this application;

FIG. 5 is a schematic diagram of an architecture of a UE-UE relaysystem;

FIG. 6 is a schematic diagram of a unicast communication methodaccording to an embodiment of this application;

FIG. 7 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application;

FIG. 8 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application;

FIG. 9 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application;

FIG. 10 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application.

FIG. 11 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application;

FIG. 12 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application;

FIG. 13 is a schematic flowchart of unicast establishment according toan embodiment of this application;

FIG. 14 is another schematic flowchart of unicast connectionestablishment according to an embodiment of this application;

FIG. 15 is another schematic flowchart of unicast connectionestablishment according to an embodiment of this application;

FIG. 16 is another schematic flowchart of unicast connectionestablishment according to an embodiment of this application;

FIG. 17 is another schematic flowchart of unicast connectionestablishment according to an embodiment of this application;

FIG. 18 is a schematic diagram of a unicast communication apparatusaccording to an embodiment of this application;

FIG. 19 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application;

FIG. 20 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application;

FIG. 21 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application;

FIG. 22 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application;

FIG. 23 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application;

FIG. 24 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application;

FIG. 25 is a schematic diagram of a structure of a communicationapparatus according to an embodiment of this application;

FIG. 26 is a schematic diagram of another structure of a communicationapparatus according to an embodiment of this application; and

FIG. 27 is a schematic diagram of another structure of a communicationapparatus according to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following describes technical solutions in this application withreference to the accompanying drawings.

The technical solutions in embodiments of this application may beapplied to various communication systems, such as a global system formobile communications (GSM) system, a code division multiple access(CDMA) system, a wideband code division multiple access (WCDMA) system,a general packet radio service (GPRS) system, a long term evolution(LTE) system, an LTE frequency division duplex (FDD) system, an LTE timedivision duplex (TDD) system, a universal mobile telecommunicationssystem (UMTS), a worldwide interoperability for microwave access (WiMAX)communication system, a 5th generation (5G) system or a new radio (NR)system, and a future evolved communication system.

A terminal device in embodiments of this application may be userequipment, an access terminal, a subscriber unit, a subscriber station,a mobile station, a remote station, a remote terminal, a mobile device,a user terminal, a terminal, a wireless communication device, a useragent, or a user apparatus. The terminal device may alternatively be acellular phone, a cordless phone, a session initiation protocol (SIP)phone, a wireless local loop (WLL) station, a personal digital assistant(PDA), a handheld device having a wireless communication function, acomputing device, another processing device connected to a wirelessmodem, a vehicle-mounted device, a wearable device, a terminal device ina future 5G network, a terminal device in a future evolved public landmobile network (PLMN), or the like. This is not limited in embodimentsof this application.

A network device in embodiments of this application may be a deviceconfigured to communicate with the terminal device. The network devicemay be a base transceiver station (BTS) in the global system for mobilecommunications (GSM) system or the code division multiple access (CDMA)system, may be a NodeB (NB) in the wideband code division multipleaccess (WCDMA) system, may be an evolved NodeB (eNB or eNodeB) in theLTE system, or may be a radio controller in a cloud radio access network(CRAN) scenario. Alternatively, the network device may be a relaystation, an access point, a vehicle-mounted device, a wearable device, anetwork device in the 5G network, a network device in the future evolvedPLMN, or the like. This is not limited in embodiments of thisapplication.

In a wireless communication system, data communication may be performedbetween UEs via a network, or communication between UEs may be directlyperformed not through a network device. An interface between the UEs isreferred to as a PC5 interface, similar to a Uu interface between a UEand a base station. A link between the UEs is referred to as a sidelink(SL). A typical application scenario of sidelink communication isvehicle-to-everything (V2X). In the vehicle-to-everything, each vehicleis one UE, and data transmission may be directly performed between UEsthrough a sidelink but not via a network. In this way, a communicationdelay can be effectively reduced.

The sidelink can support unicast communication. The unicastcommunication is similar to data communication performed after a radioresource control (RRC) connection is established between a UE and a basestation, and a unicast connection needs to be first established betweenthe two UEs. After the unicast connection is established, the two UEsmay perform data communication based on a negotiated identifier, wheredata may or may not be encrypted. Compared with broadcast communication,the unicast communication can be performed only between two UEs betweenwhich a unicast connection has been established.

FIG. 2 is a schematic flowchart of establishing a unicast connectionbetween two UEs in a conventional technology. S210: A UE 1 sends adirect communication request message to a UE 2. Optionally, the UE 1 maysend the request message in a broadcast manner. S220: The UE 1 and theUE 2 establish a security connection therebetween. S230: The UE 2 sendsa direct communication accept message to the UE 1. S240: The UE 1 andthe UE 2 establish a unicast connection therebetween, and performservice data transmission through the unicast connection.

When the UEs communicate with each other through a sidelink, acommunication distance is not very long due to factors such as aninsufficient hardware capability of a transmit-side UE. This limits ascenario in which the UEs communicate with each other through thesidelink. To resolve this problem, a UE-to-UE relay architecture isintroduced into discussions in a standard. FIG. 1 is a schematic diagramof a system architecture according to an embodiment of this application.As shown in FIG. 1 , the architecture includes an initiating UE (a UE1), a relay device (a relay UE), and a target UE (a UE 2). Networkelements in the UE-to-UE relay system may include one initiating UE 1,one target UE 2, and one or more relay UEs. Unicast communication needsto be performed between the UE 1 and the UE 2. Data or signalingtransmission may be performed between the UE 1 and the UE 2 through therelay UE.

From a perspective of a user plane protocol stack, UE-to-UE relay may beclassified into two types: network layer (layer 3, L3) relay and datalink layer (layer 2, L2) relay. FIG. 3 is a schematic diagram of a userplane protocol stack in an L2 relay architecture. User data may berelayed below a packet data convergence protocol (PDCP) layer. In the L2relay architecture, there is an end-to-end control plane connectionbetween the UE 1 and the UE 2. The control plane connection is furtherclassified into an access stratum (AS) control plane connection (whichmay be understood as an RRC connection) and an upper layer (which may beunderstood as a non-access stratum (NAS)) control plane connection. FIG.4 is a schematic diagram of a user plane protocol stack in an L3 relayarchitecture. As shown in FIG. 4 , user data is relayed at an IP layer.Optionally, in the foregoing relay architectures, there may be furtheran adaptation layer above an SL radio link control (RLC) layer. Datatransmission in the foregoing two architectures belongs to aconventional technology, and details are not excessively described inembodiments of this application.

The foregoing architecture is a schematic diagram of data transmissionperformed in the user plane protocol stack after the unicast connectionis established between the UEs through the relay UE. Before the unicastconnection is established between the UEs, an appropriate relay UE needsto be selected. In an actual application process, there may be aplurality of relay UEs between the UE 1 and the UE 2, and there may beno determined relationship between the UE 1, the UE 2, and each of theplurality of relay UEs. In other words, no unicast connection may beestablished between the relay UE and the UE 1/UE 2, and not all therelay UEs are appropriate for the UE 1 and the UE 2 between which theunicast communication needs to be performed. For example, as shown inFIG. 5 , when there are a plurality of relay UEs, a specific relay UEmay be excessively far away from the UE 2, and is not appropriate foracting as the relay device between the UE 1 and the UE 2 to transmitdata or signaling. However, in a conventional technology, there is nogood method for selecting the relay UE in a process of establishing theunicast connection between the UE 1 and the UE 2.

Embodiments of this application provide a unicast communication method.In a unicast connection establishment process, a relay UE, a UE 1,and/or a UE 2 participate/participates in relay UE selection, so that anappropriate relay UE can be selected. This helps improve a success rateof establishing a unicast connection between the UEs, and improvecommunication quality of unicast communication.

In embodiments of this application, an initiating UE may be a firstterminal device, and a target UE may be a second terminal device, or mayoptionally be a third terminal device. A specific case is determinedbased on descriptions in different embodiments. A relay device inembodiments of this application may also be referred to as the relay UE.

A reference signal in embodiments of this application may be ademodulation reference signal (DMRS) or a channel stateinformation-reference signal (CSI-RS). A type of the reference signal isnot limited in this application.

FIG. 6 is a schematic diagram of a unicast communication methodaccording to an embodiment of this application. As shown in FIG. 6 , themethod 600 includes S610 and S620. The following describes the two stepsin detail.

S610: A first relay device receives a first message sent by a firstterminal device, where the first message includes a first identifier ofa second terminal device.

The first identifier may be an application layer identifier (APP ID) ofthe second terminal device.

Optionally, the first message may include service information, forexample, a service identifier, of interest to the second terminaldevice.

In an embodiment, the first message may include indication informationindicating the first relay device to forward the first message.Optionally, the indication information may be indication informationincluded in the first message, may be indication information added to aprotocol-layer header, for example, a packet data convergence protocol(PDCP)/radio link control (RLC)/media access control (MAC)-layer header,when protocol-layer processing is performed on the first message, or maybe indication information added to physical-layer sidelink controlinformation.

In an embodiment, the first message may be only for requesting todiscover a target relay device.

In another embodiment, the first message may be for requesting toestablish a unicast connection to a target UE. In this embodiment, itmay also be understood that the first message is for requesting toestablish a unicast connection between an initiating UE and the targetUE through a target relay device.

S620: The first relay device sends a second message to the secondterminal device when transmission quality of the first message meets afirst preset condition.

In an embodiment, the second message is for establishing a first unicastconnection, and the first unicast connection is a unicast connectionestablished between the first terminal device and the second terminaldevice through the first relay device.

Optionally, the second message may be the first message that is directlyforwarded, or may be generated by the first relay device based on thefirst message. In an embodiment, that transmission quality of the firstmessage meets a first preset condition includes: A reference signalreceived power RSRP of the first message is greater than or equal to afirst threshold. Specifically, the first relay device may measure areference signal that is sent simultaneously with the first message, toobtain a reference signal received power (RSRP) value, and compare theRSRP value with the first threshold. If the RSRP measurement value isgreater than the first threshold, the first relay device continues tosend the second message; otherwise, the first relay device does not sendthe second message. Optionally, the first threshold may be obtained bythe first relay device from a base station to which the first relaydevice belongs, may be obtained from the initiating UE, or may belocally configured by the first relay device. This is not limited inthis application.

Optionally, the first relay device may alternatively perform determiningthe transmission quality of the first message based on a signal-to-noiseratio (SNR), a signal to interference plus noise ratio (SINR), referencesignal received quality (RSRQ), channel state information (CSI), or thelike of a link. Alternatively, the first relay device may determine,depending on whether the first relay device supports a unicastconnection service, whether to continue to send the second message tothe target UE. It should be understood that the first relay device mayperform determining the transmission quality of the received message byusing one of the methods or two or more of the methods. This is notlimited in this embodiment of this application.

In an embodiment, the first relay device may further perform determiningof transmission quality of a message sent by the second terminal device.Specifically, the method further includes: The first relay devicereceives a third message sent by the second terminal device, where thethird message includes the first identifier of the second terminaldevice. The first relay device forwards the third message to the firstterminal device when transmission quality of the third message meets asecond preset condition.

The relay device performs determining of the transmission quality of theresponse message (namely, the third message) of the second terminaldevice, so that different cases that exist between the relay device andthe target UE can be considered, to select a more appropriate targetrelay device. This improves a success rate of the unicast connection andcommunication quality of unicast communication.

In an embodiment, that transmission quality of the third message meets asecond preset condition includes: An RSRP of the third message isgreater than or equal to a second threshold. Specifically, the firstrelay device may measure a reference signal that is sent simultaneouslywith the third message to obtain an RSRP value, and then performdetermining based on the RSRP measurement value and the secondthreshold. Optionally, the second threshold may be obtained by the firstrelay device from the base station to which the first relay devicebelongs, may be obtained from the initiating UE, or may be locallyconfigured by the first relay device. This is not limited in thisapplication. Optionally, the second threshold in this embodiment of thisapplication may be the same as or different from the first thresholdused by the first relay device to perform determining the transmissionquality of the first message in the foregoing step. A specific value ofthe second threshold may be determined based on an actual case. This isnot limited in this embodiment of this application.

Optionally, the first relay device may alternatively perform determiningthe transmission quality of the third message based on an SNR, an SINR,RSRQ, CSI, or the like of a link.

In an embodiment, the first relay device may change a selectioncriterion, for example, lower the first/second threshold. Specifically,the first relay device receives first indication information, where thefirst indication information indicates the first relay device to changethe first preset condition and/or the second preset condition.Alternatively, optionally, the first relay device may change theselection criterion based on a local configuration, to select theappropriate target relay device.

The preset condition for selecting the target relay device is changed,so that the selection criterion can be changed when no appropriatetarget relay device is found, to ensure normal service running.

In an embodiment, when the first message is for requesting to establishthe unicast communication, the second message may also be for requestingto establish the unicast communication. A unicast communicationestablishment process belongs to a conventional technology, and detailsare not excessively described herein.

In another embodiment, when the first message is only for requesting todiscover the target relay device, the second message is also only forrequesting to discover the target relay device. In this case, the relaydevice further needs to receive, from the initiating UE, a message forestablishing the unicast connection, to establish the unicast connectionbetween the initiating UE and the target UE. Specifically, the methodfurther includes: The first relay device receives a fourth message sentby the first terminal device, where the fourth message is for requestingto establish the first unicast connection. The first relay deviceforwards the fourth message to the second terminal device. The firstrelay device receives a fifth message sent by the second terminaldevice, where the fifth message includes a unicast connection responsemessage. The first relay device forwards the fifth message to the firstterminal device. Optionally, the unicast connection response message maybe a direct communication accept message, or may be a securityestablishment related message.

In an embodiment, a unicast connection channel may already exist betweenthe first relay device and the second terminal device. In this case, thefirst relay device may obtain, in advance, the service information ofinterest to the second terminal device. Specifically, the unicastconnection has been established between the first relay device and thesecond terminal device. The method further includes: The first relaydevice receives a sixth message sent by the second terminal device,where the sixth message includes a service identifier of the secondterminal device. Optionally, the service identifier of the secondterminal device may be the service identifier of interest to theterminal device. The service identifier of interest to the secondterminal device is obtained in advance, so that after receiving thefirst message sent by the initiating UE, the relay device may determine,based on a destination identifier corresponding to the first message,whether a service corresponding to the first message is a service ofinterest to the second terminal device, and determine, based on adetermining result, whether to send the second message to the secondterminal device. Specifically, after obtaining the first message, thefirst relay device may obtain the destination identifier correspondingto the first message, where the destination identifier is a defaultidentifier of the service corresponding to the first message. In thisway, the first relay device may determine, based on the destinationidentifier and the service of the second terminal device, whether tocontinue to send the second message. The success rate of the unicastconnection is improved by using the service information of the secondterminal device that is obtained in advance. In addition, the previouslyestablished unicast connection channel is reused, so that efficiency ofthe unicast connection can be improved, and resources can be saved.

In an embodiment, the relay device may allocate local identifiers todifferent initiating UEs, so that the target UE can distinguish betweenthe different initiating UEs. Specifically, that the first relay devicesends a second message to the second terminal device further includes:The first relay device sends a second identifier of the first terminaldevice when sending the second message, where the second identifier isallocated by the first relay device to the first terminal device.

In an embodiment, the first relay device may receive a response messageof the second terminal device after sending the second message.Specifically, the method further includes: The first relay devicereceives a seventh message and the second identifier that are sent bythe second terminal device, where the seventh message includes the firstidentifier of the second terminal device. Alternatively, the first relaydevice receives second indication information sent by the secondterminal device, where the second indication information indicates thefirst relay device to release the second identifier of the firstterminal device.

In this embodiment of this application, the relay device participates inrelay device selection in a unicast communication process, so that notonly different cases that exist between the relay device and theinitiating UE but also the different cases that exist between the relaydevice and the target UE are considered. In this way, the moreappropriate relay device can be selected in the unicast communicationprocess, to improve the success rate of the unicast connection and thecommunication quality of the unicast communication.

FIG. 7 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application. As shown in FIG. 7 , themethod 700 includes steps S710 and S720. The following describes the twosteps in detail.

S710: A first relay device receives a first message sent by a secondterminal device, where the first message includes a service identifierof the second terminal device.

In an embodiment, a unicast connection has been established between thefirst relay device and the second terminal device.

Optionally, the identifier of the second terminal device may be aservice identifier of interest to the second terminal device.

The relay device may obtain the service identifier of the secondterminal device in advance through the previously established unicastconnection channel.

Optionally, the previously established unicast connection channel may beestablished according to the unicast communication method described inthe embodiment in FIG. 6 , or may be established by using a unicastconnection establishment method in a conventional technology. A mannerof the previously established unicast connection channel is not limitedin this embodiment of this application.

S720: The first relay device determines, based on the serviceidentifier, to send a second message to the second terminal device.

In an embodiment, the second message is for requesting to establish afirst unicast connection, and the first unicast connection is a unicastconnection between a first terminal device and the second terminaldevice. Further, in this embodiment, the second unicast connection maybe understood as a unicast connection established between the firstterminal device and the second terminal device through the first relaydevice. Specifically, the second terminal device may perform determiningthe transmission quality of a received request message based on theservice identifier in the first message. For example, the secondterminal device may determine, based on a destination identifiercorresponding to the request message received from the first terminaldevice, whether a service corresponding to the request message is aservice of interest to the second terminal device. The second terminaldevice determines, based on a determining result, whether to send thesecond message to the second terminal device.

Determining is performed on the received request message by using theservice identifier of the second terminal device that is obtained inadvance, and further, the request message for establishing the unicastconnection is sent to the second terminal device. In addition, thepreviously established unicast connection channel is reused, so thatefficiency of establishing the unicast connection can be improved, andresources can be saved.

In an embodiment, the method further includes: The first relay devicereceives a third message sent by the first terminal device, where thethird message includes a first identifier of the second terminal device.The first relay device determines, when transmission quality of thethird message meets a first preset condition, to send the second messageto the second terminal device.

Optionally, the first relay device may determine, based on the serviceidentifier of the second terminal device or the transmission quality ofthe request message received from the first terminal device, whether tocontinue to forward the request message to the second terminal device,to select a more appropriate relay device.

Optionally, the second message may be the third message that is directlyforwarded, or may be generated by the first relay device based on thethird message.

In an embodiment, that transmission quality of the third message meets afirst preset condition includes: A reference signal received power RSRPof the third message is greater than or equal to a first threshold.

Optionally, the first relay device may perform determining thetransmission quality of the third message based on an SNR, an SINR,RSRQ, CSI, or the like of a link.

In an embodiment, that the first relay device sends the second messageto the second terminal device further includes: The first relay devicesends a second identifier of the first terminal device when sending thesecond message, where the second identifier is allocated by the firstrelay device to the first terminal device.

In this application, because the unicast connection channel has beenestablished between the first relay device and the second terminaldevice, the second terminal device may reuse the channel to establishunicast connections to a plurality of initiating UEs. A local identifieris allocated to the first terminal device, so that the second terminaldevice can distinguish between different initiating UEs.

In an embodiment, the method further includes: The first relay devicereceives a fourth message and the second identifier that are sent by thesecond terminal device, where the fourth message includes the firstidentifier of the second terminal device. Alternatively, the first relaydevice receives first indication information sent by the second terminaldevice, where the first indication information indicates the first relaydevice to release the second identifier of the first terminal device.

In this embodiment of this application, the previously establishedunicast connection channel between the first relay device and the secondterminal device is reused to establish unicast connections to differentinitiating UEs. In addition, the first relay device may further obtain,in advance, service information of interest to the second terminaldevice, and determine, based on the service information, whether to sendthe request message to the second terminal device. Compared with aconventional technology, this embodiment helps select the moreappropriate relay device, to improve the efficiency of the unicastconnection and save the resources.

FIG. 8 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application. As shown in FIG. 8 , themethod 800 includes steps S810 and S820. The following describes the twosteps in detail.

S810: A first relay device receives a first message sent by a firstterminal device, where the first message is for requesting to establisha second unicast connection.

In an embodiment, the second unicast connection is a unicast connectionbetween the first terminal device and a third terminal device. Further,in this embodiment, the second unicast connection may be understood as aunicast connection established between the first terminal device and thethird terminal device through the first relay device. A unicastconnection has been established between the first relay device and thefirst terminal device.

Optionally, the previously established unicast connection channel may beestablished according to the unicast communication method described inthe embodiment in FIG. 6 , or may be established by using a unicastconnection establishment method in a conventional technology. A mannerof the previously established unicast connection channel is not limitedin this embodiment of this application.

It should be understood that a first unicast connection may have beenestablished between the first terminal device and a second terminaldevice through the first relay device. Herein, the first terminal devicemay establish, through the unicast connection channel that has beenestablished between the first terminal device and the first relaydevice, the second unicast connection to the third terminal devicedifferent from the second terminal device.

Optionally, the first message may include an identifier, for example, anapplication layer identifier, of the second terminal device, or mayfurther include service information of interest to the second terminaldevice.

Optionally, the first message may further include a default layer-2(layer-2, L2) identifier corresponding to a unicast connection requestservice. Alternatively, when sending the first message to the firstrelay device, the first terminal device further sends a default L2identifier corresponding to a unicast connection service. Because theunicast connection has been established between the first relay deviceand the first terminal device, the first relay device can identify thedefault layer identifier without using indication information.

In this embodiment of this application, the unicast connection alreadyexists between the first terminal device and the relay device, so that aUE can reuse the previously established unicast connection channel toestablish a unicast connection to a target UE. This improves efficiencyof the unicast connection and saves resources.

In an embodiment, that a first relay device receives a first messagesent by a first terminal device further includes: The first relay devicereceives a third identifier of the third terminal device when receivingthe first message, where the third identifier is allocated by the firstterminal device to the third terminal device.

Because the unicast connection has been established between the firstrelay device and the first terminal device, the first terminal devicemay reuse the unicast connection to establish unicast connections todifferent target UEs. Therefore, the first terminal device may allocatelocal identifiers to the different target UEs, so that the firstterminal device can distinguish between the different target UEs.

S820: The first relay device sends, to the third terminal device, asecond message and a corresponding service identifier for establishingthe second unicast connection.

In an embodiment, the second message is for requesting to establish thesecond unicast connection to the third terminal device.

Optionally, the second message may be the first message that is directlyforwarded, or may be generated by the first relay device based on thefirst message.

Optionally, the service identifier corresponding to the second unicastconnection may be the default layer-2 identifier received from the firstterminal device, or may be generated by the first relay device.Specifically, after receiving the first message, the first relay devicemay parse a data packet in the first message to obtain the serviceinformation corresponding to the first message, to determine theidentifier corresponding to the unicast connection service.

Because the unicast connection has been established between the firstrelay device and the first terminal device, the first terminal devicemay reuse the unicast connection to establish the unicast connections tothe different target UEs. Therefore, the first relay device may allocatelocal identifiers to the different target UEs, so that the firstterminal device can distinguish between the different target UEs.

In an embodiment, the first relay device may perform, based on differentcases that exist between the first relay device and the third terminaldevice, determining of transmission quality of a received message sentby the third terminal device, to select an appropriate target relaydevice. Specifically, the method further includes: The first relaydevice receives a third message sent by the third terminal device, wherethe third message includes a response message for a second unicastconnection request. The first relay device determines whethertransmission quality of the third message meets a third presetcondition.

In an embodiment, that transmission quality of the third message meets athird preset condition includes: An RSRP of the third message is greaterthan or equal to a third threshold. Specifically, the relay device maymeasure a reference signal that is sent simultaneously with the thirdmessage, to obtain an RSRP value, and then perform determining of theRSRP measurement value based on a first RSRP threshold in the thirdpreset condition. Optionally, the first relay device may alternativelyperform determining the transmission quality of the third message basedon an SNR, an SINR, RSRQ, CSI, or the like of a link. Optionally, thefirst threshold may be obtained by at least one candidate relay UE froma base station to which the at least one candidate relay UE belongs, maybe obtained from the initiating UE, or may be locally configured by therelay UE. This is not limited in this application.

In an embodiment, when the transmission quality of the third messagemeets the third preset condition, the method further includes: The firstrelay device sends a fourth message and a fourth identifier of the thirdterminal device to the first terminal device, where the fourth messageincludes a first identifier of the second terminal device, and thefourth identifier is allocated by the first relay device to the thirdterminal device.

In another embodiment, when the transmission quality of the thirdmessage does not meet the third preset condition, the method furtherincludes: The first relay device sends third indication information tothe first terminal device, where the third indication informationindicates that the first relay device cannot be configured to establishthe second unicast connection.

FIG. 9 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application. As shown in FIG. 9 , themethod 900 includes steps S910 and S920. The following describes the twosteps in detail.

S910: A second terminal device receives a first message sent by at leastone candidate relay device, where the first message includes a firstidentifier of the second terminal device.

Optionally, the first identifier of the second terminal device may be anapplication layer identifier of the second terminal device.

In an embodiment, the first message may be only for requesting todiscover a target relay device.

In another embodiment, the first message may be for requesting toestablish a unicast connection to a target UE. In this embodiment, itmay also be understood that the first message is for requesting toestablish a unicast connection between an initiating UE and the targetUE through a target relay device.

S920: The second terminal device sends, when transmission quality of thefirst message meets a first preset condition, a second message to atleast one candidate relay device that meets the first preset condition;or when transmission quality of the first message does not meet a firstpreset condition, the second terminal device discards the first messageor makes no response.

In an embodiment, the second message is for establishing a first unicastconnection, and the first unicast connection is a unicast connectionbetween a first terminal device and the second terminal device. Further,in this embodiment, the first unicast connection may be understood as aunicast connection established between the first terminal device and thesecond terminal device through a first relay device, and the first relaydevice is one of the at least one candidate relay device.

In this embodiment of this application, the second terminal deviceperforms determining of transmission quality of the second message, sothat different cases that exist between the relay device and the targetUE can be considered, to select a more appropriate target relay device.This improves a success rate of the unicast connection and communicationquality of unicast communication.

In an embodiment, that transmission quality of the first message meets afirst preset condition includes: A reference signal received power RSRPof the first message is greater than or equal to a first threshold.Specifically, the second terminal device may measure a reference signalthat is sent simultaneously with the first message, to obtain a firstRSRP value, and then compare the first RSRP value with the firstthreshold, to select the appropriate target relay device. Optionally,the first threshold may be obtained by the second terminal device from abase station to which the second terminal device belongs, may beobtained from the relay UE or the initiating UE, or may be locallyconfigured by the second terminal device. This is not limited in thisapplication.

Optionally, the second terminal device may alternatively performdetermining the transmission quality of the first message based on anSNR, an SINR, RSRQ, CSI, or the like of a link.

In an embodiment, the first message further includes a transmissionquality result of a third message, and the third message is sent by thefirst terminal device to the at least one candidate relay device. Thattransmission quality of the first message meets a first preset conditionfurther includes: A reference signal received power RSRP of the thirdmessage is greater than or equal to a second threshold. Specifically,the second terminal device may measure a reference signal that is sentsimultaneously with the third message, to obtain a second RSRP value.Optionally, the second terminal device may obtain two thresholds. Thefirst threshold corresponds to a measurement result of the referencesignal for the first message, and the second threshold corresponds to ameasurement result of the reference signal for the third message. Acorresponding relay device is considered to be selected only when thetwo measurement results are respectively greater than or equal to thecorresponding thresholds. When a plurality of candidate relay devicesmeet the condition, the second terminal device may autonomously select acandidate relay device, select a candidate relay device with a largestsum of two values, or select a candidate relay device with a largestweighted sum of the two measurement results. In this case, two weightingcoefficients and the two thresholds may be obtained by the secondterminal device from a network, obtained from the first terminal device,or preconfigured by the second terminal device. Alternatively,optionally, the second terminal device obtains only one first threshold,compares the two measurement results with the first threshold, andselects a corresponding target relay device only when both the twomeasurement results are greater than or equal to the first threshold.When a plurality of relay devices meet the condition, a processingmethod is the same as that described above.

In the foregoing embodiment, the second terminal device may performdetermining of not only the transmission quality of the received secondmessage but also the transmission quality of the first message receivedby the relay device, so that the second terminal device cancomprehensively consider different cases of a plurality of links betweenthe first terminal device, the target relay device, and the secondterminal device, to select the more appropriate target relay device toestablish the unicast connection.

In an embodiment, the second terminal device may select, from theplurality of candidate relay devices, only one optimal relay device asthe target relay device. Specifically, that the second terminal devicesends, when transmission quality of the first message meets a firstpreset condition, a second message to at least one candidate relaydevice that meets the first preset condition further includes: Thesecond terminal device selects the first relay device from the at leastone candidate relay device based on a second preset condition. Thesecond terminal device sends the second message to the first relaydevice.

Alternatively, optionally, the second terminal device may select, fromthe plurality of candidate relay devices based on a first threshold, aplurality of relay devices that meet the condition. This is not limitedin this embodiment of this application.

Optionally, the foregoing threshold may be the same as or different fromthe first threshold and the second threshold that are respectively usedby the second terminal device to perform determining the transmissionquality of the first message and the third message. A specific case isdetermined based on an actual requirement. This is not limited in thisembodiment of this application.

In an embodiment, after a procedure of the first round of unicastcommunication, if the second terminal device finds no available targetrelay device, a criterion for selecting the target relay device may bechanged. Optionally, the method further includes: The second terminaldevice receives first indication information, where the first indicationinformation indicates the second terminal device to change the firstpreset condition and/or the second preset condition.

The preset condition for selecting the relay device is changed based onan actual case, to ensure normal service running.

In an embodiment, when the first message in this embodiment of thisapplication is for requesting to establish the unicast connection, themethod further includes: The second terminal device receives a fourthmessage sent by the first relay device, where the fourth message is forrequesting to establish the first unicast connection. The secondterminal device sends a fifth message to the first relay device, wherethe fifth message includes a unicast connection response message.Optionally, the unicast connection response message may be a directcommunication accept message, or may be a security establishment relatedmessage.

In an embodiment, unicast connections may already exist between thesecond terminal device and the plurality of candidate relay devices. Inthis case, the target UE may establish a unicast connection to anotherinitiating UE by using the previously established unicast connection.Specifically, a unicast connection has been established between thesecond terminal device and the at least one candidate relay device, andthe method further includes: The second terminal device sends a sixthmessage to the at least one candidate relay device, where the sixthmessage includes a service identifier of the second terminal device.Optionally, the service identifier may be a service identifier ofinterest to the second terminal device. Optionally, the previouslyestablished unicast connection channel may be established according tothe unicast communication method described in the embodiment in FIG. 6 ,or may be established by using a unicast connection establishment methodin a conventional technology. A manner of the previously establishedunicast connection channel is not limited in this embodiment of thisapplication.

Because the unicast connection has been established between the secondterminal device and the relay device, the second relay device may send,in advance, service information (for example, the service identifier) ofinterest to the second relay device to the relay device that establishesthe unicast connection to the second relay device, so that whenreceiving a request message sent by the initiating UE, the relay devicemay perform, based on the service information, determining thetransmission quality of the request message, to determine whether tocontinue to send a message to the second terminal device. This improvesthe success rate of the unicast connection.

When the unicast connection already exists between the second terminaldevice and the relay device, that the second terminal device determineswhether the transmission quality of the first message meets the firstpreset condition may include different cases. Specifically, because theunicast connection has been established between the second terminaldevice and the at least one relay device, when all second messagesreceived by the second terminal device come from the at least onecandidate relay device that previously establishes the unicastconnection channel to the second terminal device, the second terminaldevice may select, based on a preset condition, one relay device as thetarget relay device from the at least one candidate relay device. Thepreset condition may be performing determining based on the transmissionquality of the reference signal for the second message, load, or thelike.

Alternatively, optionally, when second messages received by the secondterminal device come from a candidate relay device that establishes aunicast connection to the second terminal device and one or more othercandidate relay devices, if transmission quality of the second messagesfrom the other candidate relay devices is higher than the threshold, anoptimal target relay device is selected from the other candidate relaydevices based on the preset condition; or if transmission quality of thesecond messages sent by the other candidate relay device does not meetthe preset condition, the candidate relay device that has previouslyestablished the unicast connection is selected as the target relaydevice. For a specific selection process, refer to the foregoing case inwhich all the second messages come from the candidate relay device thatestablishes the unicast connection to the second terminal device.Alternatively, the second terminal device may not perform determiningthe transmission quality of the other candidate relay devices first, butpreferentially select the candidate relay device that previouslyestablishes the unicast connection channel to the second terminaldevice. For a specific selection process, refer to the foregoing case inwhich all the second messages come from the candidate relay device thatestablishes the unicast connection to the second terminal device. If noappropriate target relay device is selected, the target relay device isthen selected from the other candidate relay devices.

In an embodiment, that a second terminal device receives a first messagesent by at least one candidate relay device further includes: The secondterminal device receives a second identifier of the first terminaldevice when receiving the first message, where the second identifier isallocated by the at least one candidate relay device to the firstterminal device.

A local identifier is allocated to the first terminal device, so thatthe target UE can distinguish between different initiating UEs.

In an embodiment, that the second terminal device sends a second messageto at least one candidate relay device that meets the first presetcondition further includes: The second terminal device sends a secondidentifier of the second terminal device when sending the secondmessage.

In an embodiment, when the transmission quality of the first messagemeets the first preset condition, the second terminal device may furthersend second indication information to the at least one candidate relaydevice that meets the first preset condition, where the secondindication information indicates the first relay device to release thesecond identifier. When finding that the first message is not forsearching for the terminal device, the second terminal device mayindicate the relay device to release the identifier allocated to thesecond terminal device.

In this embodiment of this application, the target UE selects the targetrelay device in a unicast communication process, to improve the successrate of the unicast connection and the communication quality of theunicast communication.

FIG. 10 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application. As shown in FIG. 10 ,the method includes S1001. The following describes this step in detail.

S1001: A second terminal device sends a first message to at least onecandidate relay device, where the first message includes a serviceidentifier of the second terminal device, and a unicast connection hasbeen established between the second terminal device and the at least onecandidate relay device.

Optionally, the service identifier of the second terminal device may bea service identifier of interest to the second terminal device.

The second terminal device may send the service identifier of the secondterminal device to the relay device in advance through the previouslyestablished unicast connection channel, so that the relay device mayperform monitoring for the second terminal device based on the serviceidentifier, to send, to the second terminal device, a request messagethat conforms with a service of interest to the second terminal device.This improves efficiency of a unicast connection.

Optionally, the previously established unicast connection channel may beestablished according to the unicast communication method described inthe embodiment in FIG. 6 , or may be established by using a unicastconnection establishment method in a conventional technology. A mannerof the previously established unicast connection channel is not limitedin this embodiment of this application.

In an embodiment, the method further includes: The second terminaldevice receives a second message sent by the at least one candidaterelay device, where the second message is for requesting to establish afirst unicast connection, the first unicast connection is a unicastconnection established between a first terminal device and the secondterminal device through a first relay device, and the first relay deviceis one of the at least one candidate relay device. The second terminaldevice sends a third message to the at least one candidate relay device.Alternatively, when transmission quality of the second message meets afirst preset condition, the second terminal device sends a third messageto at least one candidate relay device that meets the first presetcondition. Alternatively, when transmission quality of the secondmessage does not meet a first preset condition, the second terminaldevice discards the first message or makes no response. The thirdmessage includes a unicast connection response message. Optionally, theunicast connection response message may be a direct communication acceptmessage, or may be a security establishment related message.

Because the unicast connection has been established between the secondterminal device and the at least one relay device, when all secondmessages received by the second terminal device come from the at leastone candidate relay device that previously establishes the unicastconnection channel to the second terminal device, the second terminaldevice may directly send the third message to the at least one candidaterelay device without performing determining the transmission quality ofthe second messages; or optionally, the second terminal device mayselect one relay device as a target relay device from the at least onecandidate relay device based on a preset condition, where the presetcondition may be performing determining based on transmission quality ofa reference signal for the second message, load, or the like.

Alternatively, optionally, when second messages received by the secondterminal device come from a candidate relay device that establishes aunicast connection to the second terminal device and one or more othercandidate relay devices, if transmission quality of the second messagesfrom the other candidate relay devices is higher than a threshold, anoptimal target relay device is selected from the other candidate relaydevices based on the preset condition; or if transmission quality of thesecond messages sent by the other candidate relay device does not meetthe preset condition, the candidate relay device that has previouslyestablished the unicast connection is selected as the target relaydevice. For a specific selection process, refer to the foregoing case inwhich all the second messages come from the candidate relay device thatestablishes the unicast connection to the second terminal device.Alternatively, the second terminal device may not perform determiningthe transmission quality of the other candidate relay devices first, butpreferentially select the candidate relay device that previouslyestablishes the unicast connection channel to the second terminaldevice. For a specific selection process, refer to the foregoing case inwhich all the second messages come from the candidate relay device thatestablishes the unicast connection to the second terminal device. If noappropriate target relay device is selected, the target relay device isthen selected from the other candidate relay devices.

Another step is similar to the content in the embodiment of thisapplication in FIG. 9 , and repeated descriptions are not provided inthis embodiment of this application.

FIG. 11 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application. As shown in FIG. 9 , themethod includes S1110 to S1130. The following describes the severalsteps in detail.

S1110: A first terminal device sends a first message to at least onecandidate relay device, where the first message includes a firstidentifier of a second terminal device.

Content included in the first message is the same as the contentincluded in the first message in the embodiment of this application inFIG. 6 . Details are not described herein again.

S1120: The first terminal device receives a second message sent by theat least one candidate relay device, where the second message includesthe first identifier of the second terminal device.

Optionally, when the first message is only for requesting to discover atarget relay device, the second message may include only a responsemessage for a discovery message. Alternatively, when the first messageis for requesting to establish a unicast connection to a target UE, inthis embodiment, it may also be understood that the second message isfor requesting to establish a unicast connection between an initiatingUE and the target UE through a target relay device. The second messagemay include a unicast connection response message. Optionally, theunicast connection response message may be a direct communication acceptmessage or a security establishment message.

S1130: The first terminal device sends a third message to a first relaydevice when transmission quality of the second message meets a firstpreset condition.

In an embodiment, the third message is for establishing a first unicastconnection, the first unicast connection is a unicast connectionestablished between the first terminal device and the second terminaldevice through the first relay device, and the first relay device is oneof the at least one candidate relay device.

In this embodiment of this application, the initiating UE performsdetermining the transmission quality of the relay device in a unicastcommunication process, to select an appropriate target relay device.This improves a success rate of the unicast connection and quality ofunicast communication.

In an embodiment, that transmission quality of the second message meetsa first preset condition includes: A reference signal received powerRSRP of the second message is greater than or equal to a firstthreshold. Specifically, the first terminal device may measure areference signal that is sent simultaneously with the second message, toobtain an RSRP value, and then perform determining of the RSRPmeasurement value based on the first threshold in the preset condition,to determine whether to send the third message to the first relaydevice. Optionally, the first terminal device may alternatively performdetermining the transmission quality of the second message based on anSNR, an SINR, RSRQ, CSI, or the like of a link. Optionally, the firstthreshold may be obtained by the first relay device from a base stationto which the first relay device belongs, or may be locally configured bythe first terminal device. This is not limited in this application.

In an embodiment, the first message is for requesting to establish thefirst unicast connection, the third message includes first indicationinformation, and the first indication message indicates the secondterminal device to establish the first unicast connection to the firstterminal device through the first relay device.

In another embodiment, the first message is for requesting to discoverthe target relay device, and the third message is for requesting toestablish the first unicast connection to the second terminal devicethrough the first relay device.

FIG. 12 is a schematic diagram of another unicast communication methodaccording to an embodiment of this application. As shown in FIG. 12 ,the method 1200 includes steps S1210 and S1220. The following describesthe two steps in detail.

S1210: A first terminal device generates a first message, where thefirst message is for requesting to establish a second unicastconnection.

In an embodiment, the first message includes information about acorresponding service identifier for establishing the second unicastconnection, where a unicast connection has been established between atleast one candidate relay device and the first terminal device, and thesecond unicast connection is a unicast connection established betweenthe first terminal device and a second terminal device. Further, in thisembodiment, the second unicast connection may be understood as a unicastconnection established between the first terminal device and a thirdterminal device through a first relay device. The first relay device isone of the at least one candidate relay device.

S1220: The first terminal device sends the first message to the at leastone candidate relay device.

In an embodiment, the method further includes: The first terminal devicereceives a second message and a second identifier of the second terminaldevice that are sent by the first relay device, or receives secondindication information sent by the first relay device, where the secondidentifier of the second terminal device is allocated by the first relaydevice or the first terminal device to the second terminal device, andthe second indication information indicates that the first relay devicecannot be configured to establish the unicast connection.

Because the first terminal device can establish unicast connections to aplurality of different target UEs through the previously establishedunicast connection channel between the first terminal device and thefirst relay device, the first terminal device can distinguish betweenthe different target UEs by allocating local identifiers to the targetUEs.

In an embodiment, that the first terminal device sends the first messageto the at least one candidate relay device further includes: The firstterminal device sends a third identifier of the third terminal devicewhen sending the first message, where the third identifier is allocatedby the first terminal device to the third terminal device.

The local identifier is allocated to the target UE, so that the firstterminal device can distinguish between the different target UEs.

In an embodiment, after the first round of unicast connection, if thefirst terminal device does not find an appropriate target relay deviceto establish the unicast connection, a criterion for selecting thetarget relay device may be lowered. Optionally, the first terminaldevice may send indication information to the relay device and/or thetarget UE, to indicate the relay device and/or the target UE to change apreset condition of the relay device and/or the target UE. Specifically,the method further includes: The first terminal device sends secondindication information, where the second indication informationindicates the first relay device and the second terminal device tochange the preset condition. Alternatively, optionally, the firstterminal device may lower, based on a local configuration, the criterionfor selecting the target relay device.

The criterion for selecting the target relay device is changed, toensure that the appropriate target relay device can be found toestablish the unicast connection. This ensures normal service running.

In this embodiment of this application, because the unicast connectionhas been established between the first terminal device and the relaydevice, the first terminal device may reuse the previously establishedunicast connection channel to establish the unicast connections to thedifferent target UEs. This improves efficiency of the unicast connectionand saves resources.

FIG. 13 is a schematic flowchart of unicast connection establishmentaccording to an embodiment of this application. As shown in FIG. 13 , inS1301, an initiating UE sends a first message to at least one candidaterelay device (for example, a relay device 1, a relay device 2, and arelay device 3), where the first message may include identifiers of theinitiating UE and a target UE, for example, application layeridentifiers (APP IDs) of the UEs, or service information of interest tothe target UE.

When sending the first message, the initiating UE further sends adestination identifier and a source identifier. Optionally, thedestination identifier herein may be a default identifier correspondingto a unicast connection service. The destination identifier and thesource identifier may be carried in a MAC header; or the sourceidentifier is carried in a MAC header, a part of the destinationidentifier is carried in the MAC header, and the other part is carriedin physical-layer sidelink control information (SCI). The first messagemay include indication information, and the indication informationindicates the at least one candidate relay UE to forward the firstmessage. Optionally, the indication information may be indicationinformation included in the first message, may be indication informationadded to a protocol-layer header, for example, a PDCP/RLC/MAC-layerheader when protocol-layer processing is performed by the initiating UEon the first message, or may be indication information added to thephysical-layer sidelink control information. Alternatively, thedestination identifier may be an identifier corresponding to a serviceof the relay UE, and the identifier corresponding to the service of therelay UE may be an identifier used by the initiating UE to search forthe relay UE and establish a unicast connection to the target UE throughthe relay device.

Optionally, the first message may be only for searching for the targetrelay UE. Alternatively, the first message may be for requesting toestablish the unicast connection between the initiating UE and thetarget UE. In this embodiment of this application, it may also beunderstood that the first message is for requesting to establishing theunicast connection to the target UE through a target relay device. Inother words, in this embodiment of this application, a process ofsearching for the relay UE and a process of establishing the unicastconnection between the initiating UE and the target UE may be combinedor may be separately performed.

S1302 a: The at least one candidate relay UE may perform determining oftransmission quality of the received first message, to determine whetherto continue to send a second message to the target UE. Optionally, thetransmission quality of the first message herein may be: The at leastone relay UE may perform determining based on an RSRP of a referencesignal that is sent simultaneously with the first message. When an RSRPvalue that is of the reference signal for the first message and that isobtained through measurement is greater than a first threshold, therelay device sends the second message to the target UE; otherwise, therelay device does not send the second message. Optionally, the firstthreshold may be obtained by the at least one candidate relay UE from abase station to which the at least one candidate relay UE belongs, maybe obtained from the initiating UE, or may be locally configured by therelay UE. This is not limited in this application. It should beunderstood that the at least one candidate relay UE may store theidentifier corresponding to the initiating UE. When finding that thefirst message carries an identifier of interest to the at least onecandidate relay UE or an identifier that the at least one candidaterelay UE can identify, the at least one candidate relay UE may acceptthe discovery message. Alternatively, optionally, the at least onecandidate relay UE may perform determining the transmission quality ofthe first message based on an SNR, an SINR, RSRQ, CSI, or the like of alink, or may determine, depending on whether the relay device supportsthe unicast connection service, whether to continue to send the secondmessage to the target UE. A manner of performing determining of thesignal transmission quality is not limited in this embodiment of thisapplication.

S1302 b: The at least one candidate relay UE sends the second message tothe target UE, where the second message may include the identifiers ofthe initiating UE and the target UE or the service information ofinterest to the target UE in the first message. Optionally, the relay UEmay send the second message in a broadcast manner. Optionally, thesecond message sent by the at least one candidate relay UE may be thefirst discovery message that is directly forwarded, or may be generatedby the at least one candidate relay UE and sent to the target UE.Optionally, the second message may further include indicationinformation for notifying the target UE that the second message is fromthe relay UE. Optionally, the indication information may be indicationinformation included in the first message, may be indication informationadded to a protocol-layer header, for example, a PDCP/RLC/MAC-layerheader when protocol-layer processing is performed by the initiating UEon the first message, or may be indication information added tophysical-layer sidelink control information.

It should be understood that when sending the second message, the atleast one relay UE includes a destination identifier and a sourceidentifier. Optionally, the destination identifier herein may be thedefault identifier corresponding to the unicast connection service orthe identifier corresponding to the service of the relay UE. It may beunderstood that the identifier corresponding to the service of the relayUE is used by the target UE to determine, after the target UE receivesthe second message, that the message is forwarded by the relay UE. Thesource identifier herein may be an identifier allocated by the relay UEto perform unicast communication with the target UE.

Optionally, the second message may be the first message that is directlyforwarded, or may be generated by the first relay device based on thefirst message.

Optionally, when the first message is only for discovering the targetrelay device, the second message is also only for discovering the targetrelay device. Alternatively, when the first message is further forrequesting to establish the unicast connection between the initiating UEand the target UE, the second message may also be for requesting toestablish the unicast connection.

S1303: The target UE sends a third message to the at least one candidaterelay UE, where the third message may include the identifier, forexample, the application layer identifier APP ID, of the target UE.Optionally, a destination identifier used by the target UE to send thethird message may be the source identifier used by the relay UE to sendthe second message.

Optionally, when the first message and the second message are only fordiscovering the target relay device, the third message may include onlya response message in response to discovering the target relay device.Alternatively, when the first message and the second message are forrequesting to establish the unicast connection, the third message is amessage in response to the request, and may specifically include adirect communication accept message or a security establishment message.In this case, the target UE may establish the unicast connection to theinitiating UE through the relay UE. A specific procedure is that shownin FIG. 2 . The unicast establishment procedure belongs to aconventional technology, and a manner of establishing the unicastconnection is not limited in this application.

Optionally, in S1304 a, the at least one relay UE may further performdetermining the transmission quality of the third message, and forwardthe third message when transmission quality of the third message meets apreset condition. Optionally, the at least one relay UE may perform,based on a second RSRP threshold, determining of an RSRP value of areference signal sent together with the third message. The secondthreshold may be obtained by the at least one candidate relay UE from abase station to which the at least one candidate relay UE belongs, maybe obtained from the initiating UE, or may be locally configured by therelay UE. This is not limited in this application. Optionally, the relayUE may alternatively perform determining the transmission quality of thefirst message based on an SNR, an SINR, RSRQ, CSI, or the like of alink. This is not limited in this embodiment of this application.

S1304 b: The at least one candidate relay UE forwards the third messageto the initiating UE, where the third message may include the identifierof the target UE. Optionally, a destination identifier used by the relayUE to send the third message to the initiating UE is the sourceidentifier used by the initiating UE to send the first message, and therelay UE sends the third message to the initiating UE by using thedestination identifier.

S1305: The initiating UE selects the target relay UE based on thereceived third message. Optionally, the initiating UE may measuretransmission quality, for example, an RSRP value, of the third message,and select a candidate relay UE with an optimal result as the targetrelay UE based on a third RSRP threshold. Further, the initiating UE mayselect the target relay UE based on the third threshold. When none ofthe candidate relay UEs meets the third threshold, the initiating UEabandons selection of the target relay UE, or re-initiates a firstmessage to search for another target relay UE that meets the condition.

S1306: The initiating UE sends a fourth message to the selected targetrelay device (herein, the target UE selects the relay device 2 as thetarget relay device). Optionally, when the first message is only fordiscovering the target relay device, the fourth message is forrequesting to establish a unicast connection to the target UE throughthe relay device 2. Alternatively, when the first message is further forrequesting to establish the unicast connection, the fourth message mayinclude indication information indicating the target UE to establish aunicast connection to the initiating UE through the relay device 2. Aspecific unicast connection establishment process belongs to theconventional technology, and details are not excessively described inthis embodiment of this application.

It should be understood that values of the thresholds in this embodimentof this application may be the same or may be different. Differentvalues may be selected based on an actual case. This is not limited inthis embodiment of this application.

FIG. 14 is another schematic flowchart of unicast connectionestablishment according to an embodiment of this application. As shownin FIG. 14 , a difference from FIG. 13 lies in: In this embodiment ofthis application, a target UE may perform selection from at least onecandidate relay UE, to determine a target relay UE. S1401 and S1402 arethe same as S1301 and S1302. In this embodiment of this application, thefirst message may be only for requesting to discover the target relaydevice, or may be further for requesting to establish the unicastconnection. This is the same as the content in the embodiment of thisapplication in FIG. 13 . Details are not excessively described again inthis embodiment of this application.

A difference from the embodiment of this application in FIG. 13 lies in:In this embodiment of this application, the target UE selects the targetrelay UE from the at least one relay UE, and sends a third message tothe target relay device in a unicast manner. S1403 a: The target UE mayperform, based on a first RSRP threshold, determining of an RSRP valueof a received reference signal that is sent simultaneously with thesecond message. Optionally, the first threshold may be included by theinitiating UE in the first message. The relay UE may include the firstthreshold when sending the second message. Then, the target UE mayperform determining based on the first threshold, to select an optimaltarget relay UE. In this embodiment of this application, the target UEselects the relay device 1 as an optimal target relay UE. Optionally,the at least one candidate relay UE may modify the first threshold andthen send a modified first threshold to the target UE. In this case,thresholds in request messages received by the target UE from differentcandidate relay UEs may be different. Alternatively, the target UE mayperform determining the transmission quality of the first message basedon an SNR, an SINR, RSRQ, CSI, or the like of a link, or perform,depending on whether the target UE is authorized to establish a unicastconnection to the candidate relay UE, selection from the at least onerelay UE. A determining manner is not limited in this embodiment of thisapplication.

S1403 b: The target UE sends the third message to the relay UE.Optionally, the target UE sends, in a unicast manner, the third messageto the target relay device (where the target relay device in thisembodiment of this application is the relay device 1) selected in S1403a.

Optionally, when performing selection from the at least one candidaterelay UE, the target UE may select, based on the first RSRP threshold, aplurality of relay UEs that meet the requirement. For example, RSRPmeasurement values of reference signals of the plurality of relay UEsare greater than the threshold of the target UE. In this case, thetarget UE may send the third message to the plurality of relay UEs thatmeet the condition.

When the first message sent by the initiating UE is only for requestingto discover the target relay device, the third message may include onlya response message in response to requesting to discover the targetrelay device. Alternatively, when the first message sent by theinitiating UE is further for requesting to establish the unicastconnection between the initiating UE and the target UE, the thirdmessage may include a unicast connection response message. Optionally,the unicast connection response message may be a direct communicationaccept message, or may be a security establishment procedure relatedmessage. The target UE may establish the unicast connection to theinitiating UE through the target relay UE by using the two types ofmessages. A specific establishment process belongs to a conventionaltechnology. The unicast connection establishment process is not limitedin this embodiment of this application.

S1404: The target relay UE forwards the third message to the initiatingUE. When the first message sent by the initiating UE is only forrequesting to discover the target relay device, the third messageincludes only the response message in response to discovering the targetrelay device. Alternatively, when the first message sent by theinitiating UE is for requesting to establish the unicast connection,after receiving the third message, the initiating UE establishes theunicast connection to the target UE through the target relay UE byusing, for example, the direct communication accept message or thesecurity establishment procedure related message in S1403.

Optionally, in S1403 a, the target UE selects at least one relay UE thatmeets the condition, and sends the third message to the at least onerelay UE. In this case, the relay UE may further measure a referencesignal that is sent simultaneously with the received third message, toobtain an RSRP value, and compare the RSRP value with a secondthreshold. A specific comparison manner is the same as that in theembodiment in FIG. 13 . Details are not excessively described again inthis embodiment of this application.

S1405: Optionally, when the first message sent by the initiating UE isonly for discovering the target relay UE, to be specific, when a relayUE discovery process and a unicast connection establishment process areindependent of each other, the initiating UE may further send a fourthmessage to the target relay UE after receiving the third messageforwarded by the target relay UE, to request to establish the unicastconnection to the target UE through the relay device 1. The unicastconnection establishment process belongs to the conventional technology,and details are not excessively described in this embodiment of thisapplication.

It should be understood that values of the thresholds in this embodimentof this application may be the same or may be different. Differentvalues may be selected based on an actual case. This is not limited inthis embodiment of this application.

FIG. 15 is another schematic flowchart of unicast connectionestablishment according to an embodiment of this application. Thisembodiment of this application is similar to the embodiment in FIG. 14 .A difference lies in: In this embodiment of this application, aftermeasuring a reference signal that is sent simultaneously with a firstmessage sent by an initiating UE, at least one relay UE may not performdetermining the transmission quality of the reference signal. In otherwords, in S1502 a, after measuring the reference signal for the firstmessage to obtain an RSRP value, the at least one candidate relay UE maydirectly send a second message to a target UE without determining, andinclude, in the second message, an RSRP result that is of the referencesignal and that is obtained through measurement.

Optionally, the second message may be the first message that is directlyforwarded, or may be generated by the first relay device based on thefirst message.

S1503 a: The target UE measures a received reference signal for thesecond message of the at least one candidate relay UE to obtain an RSRPvalue, performs, based on thresholds, determining of a measurementresult that is of the reference signal for the first message and that iscarried in the second message and a measurement result of the referencesignal for the second message, and selects a relay UE that meets acondition. Optionally, the target UE may obtain two thresholds. A firstthreshold corresponds to the measurement result of the reference signalfor the second message, and a second threshold corresponds to themeasurement result that is of the reference signal for the first messageand that is obtained by the relay UE. A corresponding relay UE isconsidered to be selected only when the two measurement results arerespectively greater than or equal to the corresponding thresholds. Whena plurality of relay UEs meet the condition, a UE 2 may autonomouslyselect a candidate relay device, select a candidate relay device with alargest sum of two values, or select a candidate relay device with alargest weighted sum of the two measurement results. In this case, twoweighting coefficients and the two thresholds may be obtained by the UE2 from a network, obtained from a UE 1, or preconfigured by the UE 2.Alternatively, optionally, the UE 2 obtains only one threshold, comparesthe two measurement results with the threshold, and selects acorresponding relay UE only when both the two measurement results aregreater than or equal to the threshold. When a plurality of relay UEsmeet the condition, a processing method is the same as that describedabove. Other steps are the same as those in the embodiments of thisapplication in FIG. 13 and FIG. 14 , and details are not excessivelydescribed in this embodiment of this application.

Optionally, in this embodiment of this application, the target UE mayalternatively perform determining the transmission quality of the secondmessage based on an SNR, an SINR, RSRQ, CSI, or the like of a link inthe foregoing embodiment. This is not limited in this embodiment of thisapplication.

The foregoing embodiments of this application relate to a process ofdiscovering the target relay UE and establishing the unicast connectionwhen the initiating UE and the target UE have not established theunicast connection to the relay UE. However, in an actual case, theinitiating UE and the target UE may have established the unicastconnection to the relay UE.

It should be understood that values of the thresholds in this embodimentof this application may be the same or may be different. Differentvalues may be selected based on an actual case. This is not limited inthis embodiment of this application.

FIG. 16 is another schematic flowchart of unicast connectionestablishment according to an embodiment of this application. A unicastconnection establishment process in this embodiment of this applicationis similar to those in FIG. 14 and FIG. 15 . A difference lies in: InFIG. 14 and FIG. 15 , no unicast connection is established between theinitiating UE and the relay UE or between the relay UE and the targetUE; in this embodiment of this application, a unicast connection hasbeen established between an initiating UE and at least one candidaterelay device. The following describes in detail the unicast connectionestablishment process in this embodiment of this application.

Optionally, the previously established unicast connection channel may beestablished according to the unicast communication method described inembodiments of this application, or may be established by using aunicast connection establishment method in a conventional technology. Amanner of the previously established unicast connection channel is notlimited in this embodiment of this application.

S1601: The initiating UE sends a first message to the at least onecandidate relay device in a unicast manner, where the first message isfor requesting to establish a unicast connection to a target UE througha target relay device. Optionally, the first message may include anapplication layer identifier of the initiating UE and an applicationlayer identifier of the target UE. Optionally, when sending the firstmessage, the initiating UE may further include a service identifier. Theidentifier may be a default layer-2 (layer-2, L2) identifiercorresponding to a unicast connection request service. Alternatively,when sending the first message to the at least one candidate relaydevice, the initiating UE further sends a default L2 identifiercorresponding to a unicast connection request service. Optionally, whensending the first message, the initiating UE may further include anotheridentifier of the target UE. The identifier is a local ID allocated bythe initiating UE to the target UE, so that the initiating UEdistinguishes between different target UEs. It should be understood thatthe identifier is different from the foregoing application layeridentifier of the target UE, and the application layer identifier of thetarget UE is an inherent identifier of the target UE.

It should be understood that, because the unicast connection has beenestablished between the initiating UE and the at least one candidaterelay device, the at least one candidate relay device may performidentification based on the service identifier in the request messagesent by the initiating UE.

S1602: After receiving the request message sent by the initiating UE,the at least one candidate relay device broadcasts a second message,where the second message is for requesting to establish the unicastconnection to the target UE. Optionally, a destination identifier usedfor the second message may be the default L2 identifier carried in thefirst message, or may be an identifier that corresponds to the unicastconnection service and that is determined by the at least one candidaterelay device. Specifically, after receiving the first message, the relaydevice may parse a data packet in the first message to obtain serviceinformation corresponding to the first message, to determine theidentifier corresponding to the unicast connection service. It should beunderstood that, when sending the second message, the at least one relaydevice includes a source identifier of the at least one relay device,and different candidate relay devices use different source identifiers.

Optionally, the second message may be the first message that is directlyforwarded, or may be generated by a first relay device based on thefirst message.

Step S1603 is similar to the process in which the target UE selects therelay device in FIG. 14 and FIG. 15 . In this step, the target UEselects an optimal candidate relay device as the target relay device. Inthis embodiment of this application, using a relay device 1 as anexample, a third message is sent to the relay device 1. The thirdmessage may be a unicast connection response message. Optionally, theunicast connection response message may be a direct communication acceptmessage or a security establishment related message. The target UE mayestablish the unicast connection to the initiating UE through the relaydevice 1 by using the unicast connection response message. This processbelongs to a conventional technology, and details are not excessivelydescribed herein. Optionally, the target UE may alternatively select aplurality of candidate relay devices that meet a condition, and send thethird message to the plurality of candidate relay devices that meet thecondition.

S1604: The target relay device forwards the third message to theinitiating UE. Optionally, the unicast connection established betweenthe relay device and the initiating UE may be reused by a plurality oftarget UEs, in other words, the relay device may establish unicastconnections between the initiating UE and the plurality of target UEs.In this case, when forwarding the third message to the initiating UE,the relay device may include an identifier of the target UE, where theidentifier is a local ID allocated by the target relay device or theinitiating UE to the target UE, so that the initiating UE candistinguish between different target UEs.

Optionally, in this step, the target relay device may continue toperform determining the transmission quality of the received thirdmessage, and determine whether to forward the third message to theinitiating UE. The target relay device may measure a reference signalsimultaneously received with the third message, to obtain an RSRP value,and then determine, based on a first threshold, whether the RSRP valuemeets a forwarding condition.

Optionally, when the target relay device determines that the RSRP valuefor the third message meets the first threshold, the target relay deviceforwards the third message to the initiating UE, and includes theidentifier of the target UE, where the identifier may be allocated bythe initiating UE or the target relay device to the target UE. When thetarget relay device determines that the RSRP value for the third messagedoes not meet the threshold requirement, the target relay device maysend indication information to the initiating UE, to indicate that thetarget relay device cannot be configured to establish the unicastconnection between the initiating UE and the target UE.

Through the previously established unicast connection channel, the relaydevice may directly forward the request message to the target UE withoutperforming filtering on the received unicast establishment requestmessage. In addition, the previously established unicast connectionchannel is reused to implement the unicast connection to the target UE,to improve efficiency and save resources.

FIG. 17 is another schematic flowchart of unicast connectionestablishment according to an embodiment of this application. A unicastconnection establishment process in this embodiment of this applicationis similar to those in FIG. 14 and FIG. 15 . A difference lies in: InFIG. 14 and FIG. 15 , no unicast connection is established between theinitiating UE and the relay UE or between the relay UE and the targetUE; in this embodiment of this application, a unicast connection hasbeen established between a target UE and at least one candidate relaydevice. The following describes in detail the unicast connectionestablishment process in this embodiment of this application.

Optionally, the previously established unicast connection channel may beestablished according to the unicast communication method described inembodiments of this application, or may be established by using aunicast connection establishment method in a conventional technology. Amanner of the previously established unicast connection channel is notlimited in this embodiment of this application.

S1701 is similar to the steps in FIG. 14 and FIG. 15 , and details arenot excessively described herein again. The first message sent in thisstep is for requesting to establish a unicast connection to the targetUE through a relay device. A destination identifier used for the firstmessage may be a corresponding default L2 identifier for initiating aunicast connection service. Optionally, when sending the first message,an initiating UE may further include indication information indicatingthat the message is sent to the relay device.

S1702 a: The at least one candidate relay device may further measure areference signal for the received first message, and determine, based ona threshold and a measurement result, whether to send a second messageto the target UE. A specific step is similar to the processes in whichthe relay device determines whether to forward the first message in FIG.14 and FIG. 15 . Details are not excessively described herein again.Optionally, in this embodiment of this application, because the unicastconnection may have been established between the target UE and the relaydevice, the threshold of the relay device may alternatively be obtainedfrom the target UE.

Optionally, the second message may be the first message that is directlyforwarded, or may be generated by a first relay device based on thefirst message.

Before sending the second message to the target UE, the at least onerelay device may further perform determining the transmission quality ofthe received first message based on service information of interest tothe target UE. Optionally, the at least one candidate relay device thatestablishes the unicast connection to the target UE may obtain, inadvance, the service information of interest to the target UE or thelike. The service information of interest to the target UE may be thedefault L2 identifier corresponding to the service. After receiving thefirst message, the relay device that previously establishes the unicastconnection to the target UE may determine, based on the serviceinformation obtained from the target UE, whether the first messageincludes a service of interest to the target UE. If the first messageincludes the service of interest to the target UE, the relay devicedetermines to send the second message to the target UE; otherwise, therelay device does not send the second message.

S1702 b: The at least one candidate relay device sends the secondmessage to the target UE in a unicast manner. Optionally, the secondmessage may be the first message, or the second message may be generatedby the relay device based on the first message. Optionally, when sendingthe second message to the target UE, the at least one candidate relaydevice may further include an identifier of the initiating UE. Theidentifier is a local ID allocated by the at least one relay device tothe initiating UE, so that the target UE distinguishes between differentinitiating UEs.

S1703 a: The target UE may perform determining the transmission qualityof the received second message, select a target relay device from the atleast one candidate relay device, and send a third message to the targetrelay device, where the third message may be a unicast connectionresponse message. Optionally, the unicast connection response messagemay be a direct communication accept message or a security establishmentrelated message. The target UE can establish the unicast connection tothe initiating UE through a relay device 1 by using the unicastconnection response message. This process belongs to a conventionaltechnology, and details are not excessively described herein again. Inthis embodiment of this application, the relay device 1 is used as thetarget relay device. A specific determining process is similar to theprocesses in FIG. 14 and FIG. 15 performed when the first message is forrequesting to establish the unicast connection. Details are notexcessively described again in this embodiment of this application.S1703 b: The target UE sends the third message to the relay device.

Optionally, if the target UE determines to reply to the target relaydevice 1 with the third message, when replying with the third message,the target UE may include the identifier allocated by the relay deviceto the target UE in S1702 b. Alternatively, optionally, the target UEmay allocate a local ID to the initiating UE. In this case, the thirdmessage may carry the identifier allocated by the target UE to theinitiating UE. If the target UE finds that the received second messageis not for searching for the target UE, the target UE replies to thetarget relay device 1 with indication information indicating the relaydevice to release the identifier allocated to the target UE. Optionally,the target UE may reject the unicast connection request of theinitiating UE. In this case, the target UE replies to the relay devicewith a reject message.

S1704: The target relay device forwards the third message to theinitiating UE based on the two cases in S1703, or forwards theindication information or the reject message to the initiating UE.

Through the previously established unicast connection channel, thetarget UE may send, to the at least one relay device in advance, theservice information of interest to the target UE, so that when receivingthe related request sent by the initiating UE, the relay device mayselectively forward the related request to the target UE, to improvecommunication efficiency.

Optionally, in this embodiment of this application, if the target UEconsiders that there is no appropriate relay UE, the target UE mayreject the request message. The target UE may not reply with anymessage. Alternatively, optionally, the target UE may select an optimalrelay UE from the at least one relay UE to reply with the rejectmessage.

In this embodiment of this application, if no appropriate target relayUE is found after the initiating UE sends the first message for thefirst time, it may be considered to lower a criterion for selecting thetarget relay UE, to ensure normal service initiation. Optionally,additional indication information may be carried when the initiating UEsends the first message, so that after receiving the indicationinformation, the at least one relay UE may correspondingly lower thecriterion. For example, after receiving the indication information, theat least one candidate relay UE may lower the threshold to a presetvalue or by a preset value. Alternatively, optionally, the initiating UEresends the first message including a new threshold that is lower, andsends the threshold to the relay UE and/or the target UE, so that therelay UE and/or the target UE can perform selection based on the newthreshold. Alternatively, optionally, the initiating UE may set a lowerthreshold, to lower a threshold criterion for performing determining thetransmission quality of the third message sent by the relay UE.Optionally, the preset value in this embodiment of this application maybe configured via a network.

Normal service running can be ensured by lowering the thresholdcriterion when the first unicast connection fails.

The RSRP threshold in this embodiment of this application may beobtained by the UE from a base station to which the UE belongs, may beobtained from the initiating UE, or may be stored by the UE in a localconfiguration manner. This is not limited in this application.

Optionally, in embodiments of this application, the local identifierallocated by the relay device, the initiating UE, or the target UE maybe carried at an adaptation layer above an SL RLC layer in an L2 or L3relay architecture.

FIG. 18 is a schematic diagram of a unicast communication apparatusaccording to an embodiment of this application. As shown in FIG. 18 ,the apparatus 1800 includes a first receiving module 1810, a firstprocessing module 1820, and a first sending module 1830. The apparatus1800 may be configured to implement functions of receiving, processing,and sending a message by the first relay device in any one of theforegoing method embodiments. For example, the apparatus 1800 may be arelay device. In an implementation of the apparatus 1800, the apparatus1800 includes a unit configured to implement any step or operation inthe foregoing method embodiments. The unit may be implemented byhardware, may be implemented by software, or may be implemented by acombination of hardware and software.

The apparatus 1800 may serve as a first relay device to process amessage, and perform the step of processing the request message by thefirst relay device in the foregoing method embodiments. The firstreceiving module 1810 and the first sending module 1830 may beconfigured to support the apparatus 1800 in communication, for example,performing a sending/receiving action performed by the first relaydevice in FIG. 6 to FIG. 12 . The first processing module 1820 may beconfigured to support the apparatus 1800 in performing a processingaction in the foregoing methods, for example, performing a processingaction performed by the first relay device in FIG. 6 to FIG. 12 .Specifically, refer to the following descriptions:

The first receiving module is configured to receive a first message sentby a first terminal device, where the first message includes a firstidentifier of a second terminal device. The first processing module isconfigured to determine that transmission quality of the first messagemeets a first preset condition. The first sending module is configuredto send, by the first relay device, a second message to the secondterminal device when the transmission quality of the first message meetsthe first preset condition, where the second message is for establishinga first unicast connection, and the first unicast connection is aunicast connection established between the first terminal device and thesecond terminal device through the first relay device.

Optionally, the first processing module is specifically configured todetermine that a reference signal received power RSRP of the firstmessage is greater than or equal to a first threshold.

Optionally, the first receiving module is further configured to receivea third message sent by the second terminal device, where the thirdmessage includes the first identifier of the second terminal device. Thefirst processing module is further configured to determine thattransmission quality of the third message meets a second presetcondition. The first sending module is further configured to forward thethird message to the first terminal device when the transmission qualityof the third message meets the second preset condition.

Optionally, the first processing module is specifically configured todetermine that an RSRP of the third message is greater than or equal toa second threshold.

Optionally, the first receiving module is further configured to receivefirst indication information, where the first indication informationindicates the apparatus to change the first preset condition and/or thesecond preset condition.

Optionally, the first message is for requesting to establish the firstunicast connection.

Optionally, the first message is for requesting to discover a targetrelay device.

Optionally, the first receiving module is further configured to receivea fourth message sent by the first terminal device, where the fourthmessage is for requesting to establish the first unicast connection. Thefirst sending module is further configured to forward the fourth messageto the second terminal device. The first receiving module is furtherconfigured to receive a fifth message sent by the second terminaldevice, where the fifth message includes a unicast connection responsemessage. The first sending module is further configured to forward thefifth message to the first terminal device.

Optionally, a unicast connection has been established between the firstrelay device and the second terminal device. The first receiving moduleis further configured to receive a sixth message sent by the secondterminal device, where the sixth message includes a service identifierof the second terminal device. The first processing module is furtherconfigured to determine, based on the service identifier, to send thesecond message to the second terminal device.

Optionally, a second sending module is further configured to send asecond identifier of the first terminal device when sending the secondmessage, where the second identifier is allocated by the apparatus tothe first terminal device.

Optionally, the first receiving module is further configured to: receivea seventh message and the second identifier that are sent by the secondterminal device, where the seventh message includes the first identifierof the second terminal device; or receive second indication informationsent by the second terminal device, where the second indicationinformation indicates the apparatus to release the second identifier ofthe first terminal device.

FIG. 19 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application. As shown inFIG. 19 , the apparatus 1900 includes a sixth receiving module 1910 anda sixth sending module 1920. The apparatus 1900 may be configured toimplement functions of receiving, processing, and sending a message bythe first relay device in any one of the foregoing method embodiments.For example, the apparatus 1900 may be a relay device. In animplementation of the apparatus 1900, the apparatus 1900 includes a unitconfigured to implement any step or operation in the foregoing methodembodiments. The unit may be implemented by hardware, may be implementedby software, or may be implemented by a combination of hardware andsoftware.

The apparatus 1900 may serve as a first relay device to process amessage, and perform the step of processing the request message by thefirst relay device in the foregoing method embodiments. The sixthreceiving module 1910 and the sixth sending module 1920 may beconfigured to support the apparatus 1900 in communication, for example,performing a sending/receiving action performed by the first relaydevice in FIG. 6 to FIG. 12 . Optionally, the apparatus 1900 may furtherinclude a sixth processing module. The sixth processing module may beconfigured to support the apparatus 1900 in performing a processingaction in the foregoing methods, for example, performing a processingaction performed by the first relay device in FIG. 6 to FIG. 12 .Specifically, refer to the following descriptions:

The sixth receiving module is configured to receive a first message sentby a second terminal device, where the first message includes a serviceidentifier of the second terminal device, and a unicast connection hasbeen established between the first relay device and the second terminaldevice. The sixth sending module is configured to determine, based onthe service identifier, to send a second message to the second terminaldevice, where the second message is for requesting to establish a firstunicast connection, and the first unicast connection is a unicastconnection established between a first terminal device and the secondterminal device through the first relay device.

Optionally, the sixth receiving module is further configured to receivea third message sent by the first terminal device, where the thirdmessage includes a first identifier of the second terminal device. Theapparatus further includes the sixth processing module, configured todetermine that transmission quality of the third message meets a firstpreset condition. The sixth sending module is further configured todetermine, by the first relay device when the transmission quality ofthe third message meets the first preset condition, to send the secondmessage to the second terminal device.

Optionally, the sixth processing module is specifically configured todetermine that a reference signal received power RSRP of the thirdmessage is greater than or equal to a first threshold.

Optionally, the sixth sending module is further configured to send asecond identifier of the first terminal device when sending the secondmessage, where the second identifier is allocated by the apparatus tothe first terminal device.

Optionally, the sixth receiving module is further configured to: receivea fourth message and the second identifier that are sent by the secondterminal device, where the fourth message includes a first identifier ofthe first terminal device; or receive first indication information sentby the second terminal device, where the first indication informationindicates the apparatus to release the second identifier of the firstterminal device.

FIG. 20 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application. As shown inFIG. 20 , the apparatus 2000 includes a second receiving module 2010 anda second sending module 2020. The apparatus 2000 may be configured toimplement functions of receiving, processing, and sending a message bythe first relay device in any one of the foregoing method embodiments.For example, the apparatus 2000 may be a relay device. In animplementation of the apparatus 2000, the apparatus 2000 includes a unitconfigured to implement any step or operation in the foregoing methodembodiments. The unit may be implemented by hardware, may be implementedby software, or may be implemented by a combination of hardware andsoftware.

The apparatus 2000 may serve as a first relay device to process amessage, and perform the step of processing the request message by thefirst relay device in the foregoing method embodiments. The secondreceiving module 2010 and the second sending module 2020 may beconfigured to support the apparatus 2000 in communication, for example,performing a sending/receiving action performed by the first relaydevice in FIG. 6 to FIG. 12 . Optionally, the apparatus 2000 may furtherinclude a second processing module. The second processing module may beconfigured to support the apparatus 2000 in performing a processingaction in the foregoing methods, for example, performing a processingaction performed by the first relay device in FIG. 6 to FIG. 12 .Specifically, refer to the following descriptions:

The second receiving module is configured to receive a first messagesent by a first terminal device, where the first message is forrequesting to establish a second unicast connection, the second unicastconnection is a unicast connection established between the firstterminal device and a third terminal device through the apparatus, and aunicast connection has been established between the apparatus and thefirst terminal device. The second sending module is configured to send,to the third terminal device, a second message and a correspondingservice identifier for establishing the second unicast connection, wherethe second message is for requesting to establish the second unicastconnection to the third terminal device.

Optionally, the second receiving module is specifically configured toreceive a third identifier of the third terminal device when receivingthe first message, where the third identifier is allocated by the firstterminal device to the third terminal device.

Optionally, the second receiving module is further configured to receivea third message sent by the third terminal device, where the thirdmessage includes a response message for a second unicast connectionrequest. The apparatus further includes the second processing module,configured to determine whether transmission quality of the thirdmessage meets a third preset condition.

Optionally, the second processing module is specifically configured todetermine that an RSRP of the third message is greater than or equal toa third threshold.

Optionally, the second sending module is further configured to send afourth message and a fourth identifier of the third terminal device tothe first terminal device, where the fourth message includes a firstidentifier of a second terminal device, and the fourth identifier isallocated by the first relay device to the third terminal device.

Optionally, the second sending module is further configured to sendthird indication information to the first terminal device, where thethird indication information indicates that the apparatus cannot beconfigured to establish the second unicast connection.

FIG. 21 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application. As shown inFIG. 21 , the apparatus 2100 includes a third receiving module 2110, athird processing module 2120, and a third sending module 2130. Theapparatus 2100 may be configured to implement functions of receiving,processing, and sending a message by the second terminal device in anyone of the foregoing method embodiments. For example, the apparatus 2100may be a second terminal device or a target UE. In an implementation ofthe apparatus 2100, the apparatus 2100 includes a unit configured toimplement any step or operation in the foregoing method embodiments. Theunit may be implemented by hardware, may be implemented by software, ormay be implemented by a combination of hardware and software.

The apparatus 2100 may serve as the second terminal device or the targetUE to process a message, and perform a step of processing a requestmessage by the second terminal device in the foregoing methodembodiments. The third receiving module 2110 and the third sendingmodule 2130 may be configured to support the apparatus 2100 incommunication, for example, performing a sending/receiving actionperformed by the second terminal device in FIG. 6 to FIG. 12 . The thirdprocessing module 2120 may be configured to support the apparatus 2100in performing a processing action in the foregoing methods, for example,performing a processing action performed by the second terminal deviceor the target UE in FIG. 6 to FIG. 12 . Specifically, refer to thefollowing descriptions:

The third receiving module is configured to receive a first message sentby at least one candidate relay device, where the first message includesa first identifier of the apparatus. The third processing module isconfigured to determine whether transmission quality of the firstmessage meets a first preset condition. The third sending module isconfigured to: when the transmission quality of the first message meetsthe first preset condition, send a second message to at least onecandidate relay device that meets the first preset condition, where thesecond message is for establishing a first unicast connection, the firstunicast connection is a unicast connection established between a firstterminal device and the apparatus through a first relay device, and thefirst relay device is one of the at least one candidate relay device; orwhen the transmission quality of the first message does not meet thefirst preset condition, discard the first message or make no response.

Optionally, the third processing module is specifically configured todetermine that a reference signal received power RSRP of the firstmessage is greater than or equal to a first threshold.

Optionally, the first message further includes a transmission qualityresult of a third message, and the third message is sent by the firstterminal device to the at least one candidate relay device. The thirdprocessing module is further configured to determine that a referencesignal received power RSRP of the third message is greater than or equalto a second threshold.

Optionally, the third processing module is further configured to selectthe first relay device from the at least one candidate relay devicebased on a second preset condition. The third sending module is furtherconfigured to send the second message to the first relay device.

Optionally, the third receiving module is further configured to receivefirst indication information, where the first indication informationindicates the apparatus to change the first preset condition and/or thesecond preset condition.

Optionally, the first message is for requesting to establish the firstunicast connection.

Optionally, the first message is for requesting to discover a targetrelay device.

Optionally, the third receiving module is further configured to receivea fourth message sent by the first relay device, where the fourthmessage is for requesting to establish the first unicast connection. Thethird sending module is further configured to send a fifth message tothe first relay device, where the fifth message includes a unicastconnection response message.

Optionally, a unicast connection has been established between the secondterminal device and the at least one candidate relay device. The thirdsending module is further configured to send a sixth message to the atleast one candidate relay device, where the sixth message includes aservice identifier of the apparatus.

Optionally, the third receiving module is further configured to receivea second identifier of the first terminal device when receiving thefirst message, where the second identifier is allocated by the at leastone candidate relay device to the first terminal device.

Optionally, the third sending module is further configured to send thesecond identifier of the first terminal device when sending the secondmessage.

FIG. 22 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application. As shown inFIG. 22 , the apparatus 2200 includes a seventh processing module 2210and a seventh sending module 2220. The apparatus 2200 may be configuredto implement functions of receiving, processing, and sending a messageby the second terminal device in any one of the foregoing methodembodiments. For example, the apparatus 2200 may be a second terminaldevice or a target UE. In an implementation of the apparatus 2200, theapparatus 2200 includes a unit configured to implement any step oroperation in the foregoing method embodiments. The unit may beimplemented by hardware, may be implemented by software, or may beimplemented by a combination of hardware and software.

The apparatus 2200 may serve as the second terminal device or the targetUE to process a message, and perform a step of processing a requestmessage by the second terminal device in the foregoing methodembodiments. The seventh sending module 2220 may be configured tosupport the apparatus 2200 in communication, for example, performing asending/receiving action performed by the second terminal device in FIG.6 to FIG. 12 . The seventh processing module 2210 may be configured tosupport the apparatus 2200 in performing a processing action in theforegoing methods, for example, performing a processing action performedby the second terminal device or the target UE in FIG. 6 to FIG. 12 .Optionally, the apparatus 2200 may further include a seventh receivingmodule (namely, another example of a communication unit). The seventhreceiving module may be configured to support the apparatus 2200 inperforming, for example, a sending/receiving action performed by thesecond terminal device in FIG. 6 to FIG. 12 . Specifically, refer to thefollowing descriptions:

The seventh processing module is configured to generate a first message,where the first message includes a service identifier of the apparatus.The seventh sending module is configured to send the first message to atleast one candidate relay device, where a unicast connection has beenestablished between the apparatus and the at least one candidate relaydevice.

Optionally, the apparatus further includes the seventh receiving module,configured to receive a second message sent by the at least onecandidate relay device, where the second message is for requesting toestablish a first unicast connection, the first unicast connection is aunicast connection established between a first terminal device and theapparatus through a first relay device, and the first relay device isone of the at least one candidate relay device. The seventh sendingmodule is further configured to send a third message to the at least onecandidate relay device. Alternatively, the seventh processing module isfurther configured to determine whether transmission quality of thesecond message meets a first preset condition. When the transmissionquality of the second message meets the first preset condition, theseventh sending module is further configured to send a third message toat least one candidate relay device that meets the first presetcondition, where the third message includes a unicast connectionresponse message. Alternatively, when the transmission quality of thesecond message does not meet the first preset condition, the apparatusdiscards the second message or makes no response.

Optionally, the seventh processing module is specifically configured todetermine that a reference signal received power RSRP of the secondmessage is greater than or equal to a first threshold.

Optionally, the second message further includes a transmission qualityresult of a fourth message, where the fourth message is sent by thefirst terminal device to the at least one candidate relay device. Theseventh processing module is further configured to determine that areference signal received power RSRP of the fourth message is greaterthan or equal to a second threshold.

Optionally, the seventh processing module is further configured toselect the first relay device from the at least one candidate relaydevice based on a second preset condition. The seventh sending module isfurther configured to send the third message to the first relay device.

Optionally, the seventh receiving module is further configured toreceive first indication information, where the first indicationinformation indicates the apparatus to change the first preset conditionand/or the second preset condition.

Optionally, the seventh receiving module is further configured toreceive a second identifier of the first terminal device when receivingthe second message, where the second identifier is allocated by the atleast one candidate relay device to the first terminal device.

Optionally, the seventh sending module is further configured to send asecond identifier of the first terminal device when sending the thirdmessage.

Optionally, the seventh sending module may be further configured to sendsecond indication information to the at least one candidate relaydevice, where the second indication information indicates the at leastone candidate relay device to release the second identifier.

FIG. 23 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application. As shown inFIG. 23 , the apparatus 2300 includes a fourth sending module 2310, afourth receiving module 2320, and a fourth processing module 2330. Theapparatus 2300 may be configured to implement functions of receiving,processing, and sending a message by the first terminal device in anyone of the foregoing method embodiments. For example, the apparatus 2300may be a first terminal device or an initiating UE. In an implementationof the apparatus 2300, the apparatus 2300 includes a unit configured toimplement any step or operation in the foregoing method embodiments. Theunit may be implemented by hardware, may be implemented by software, ormay be implemented by a combination of hardware and software.

The apparatus 2300 may serve as the first terminal device or theinitiating UE to process a message, and perform a step of processing arequest message by the first terminal device in the foregoing methodembodiments. The fourth receiving module 2320 and the fourth sendingmodule 2310 may be configured to support the apparatus 2300 incommunication, for example, performing a sending/receiving actionperformed by the first terminal device in FIG. 6 to FIG. 12 . The fourthprocessing module 2330 may be configured to support the apparatus 2300in performing a processing action in the foregoing methods, for example,performing a processing action performed by the first terminal device orthe initiating UE in FIG. 6 to FIG. 12 . Specifically, refer to thefollowing descriptions:

The fourth sending module is configured to send a first message to atleast one candidate relay device, where the first message includes afirst identifier of a second terminal. The fourth receiving module isconfigured to receive a second message sent by the at least onecandidate relay device, where the second message includes the firstidentifier of the second terminal device. The fourth processing moduleis configured to determine that transmission quality of the secondmessage meets a first preset condition. The fourth sending module isfurther configured to send a third message to a first relay device whenthe transmission quality of the second message meets the first presetcondition, where the third message is for establishing a first unicastconnection, the first unicast connection is a unicast connectionestablished between the apparatus and the second terminal device throughthe first relay device, and the first relay device is one of the atleast one candidate relay device.

Optionally, the fourth processing module is specifically configured todetermine that a reference signal received power RSRP of the secondmessage is greater than or equal to a first threshold.

Optionally, the first message is for requesting to establish the firstunicast connection, the third message includes first indicationinformation, and the first indication message indicates the secondterminal device to establish the first unicast connection to theapparatus through the first relay device.

Optionally, the first message is for requesting to discover a targetrelay device, and the third message is for requesting to establish thefirst unicast connection to the second terminal device through the firstrelay device.

FIG. 24 is a schematic diagram of another unicast communicationapparatus according to an embodiment of this application. As shown inFIG. 24 , the apparatus 2400 includes a fifth processing module 2410 anda fifth sending module 2420. The apparatus 2400 may be configured toimplement functions of receiving, processing, and sending a message bythe first terminal device in any one of the foregoing methodembodiments. For example, the apparatus 2400 may be a first terminaldevice or an initiating UE. In an implementation of the apparatus 2400,the apparatus 2400 includes a unit configured to implement any step oroperation in the foregoing method embodiments. The unit may beimplemented by hardware, may be implemented by software, or may beimplemented by a combination of hardware and software.

The apparatus 2400 may serve as the first terminal device or theinitiating UE to process a message, and perform a step of processing arequest message by the first terminal device in the foregoing methodembodiments. The fifth sending module 2420 may be configured to supportthe apparatus 2400 in communication, for example, performing asending/receiving action performed by the first terminal device in FIG.6 to FIG. 12 . The fifth processing module 2410 may be configured tosupport the apparatus 2400 in performing a processing action in theforegoing methods, for example, performing a processing action performedby the first terminal device or the initiating UE in FIG. 6 to FIG. 12 .Optionally, the apparatus 2400 may further include a fifth receivingmodule (namely, another example of a communication unit). The fifthreceiving module may be configured to support the apparatus 2400 inperforming, for example, a sending/receiving action performed by thefirst terminal device in FIG. 6 to FIG. 12 . Specifically, refer to thefollowing descriptions:

The fifth processing module is configured to generate a first message,where the first message is for requesting to establish a second unicastconnection, the first message includes information about a correspondingservice identifier for establishing the second unicast connection, aunicast connection has been established between the apparatus and atleast one candidate relay device, the second unicast connection is aunicast connection established between the apparatus and a thirdterminal device through a first relay device, and the first relay deviceis one of the at least one candidate relay device. The fifth sendingmodule is configured to send the first message to the at least onecandidate relay device.

Optionally, the apparatus further includes the fifth receiving module,configured to: receive a second message and a second identifier of asecond terminal device that are sent by the first relay device, orreceive second indication information sent by the first relay device,where the second identifier of the second terminal device is allocatedby the first relay device or the apparatus to the second terminaldevice, and the second indication information indicates that the firstrelay device cannot be configured to establish the unicast connection.

Optionally, the fifth sending module is further configured to send athird identifier of the third terminal device when sending the firstmessage, where the third identifier is allocated by the apparatus to thethird terminal device.

Optionally, the fifth sending module is further configured to sendsecond indication information, where the second indication informationindicates the first relay device and the second terminal device tochange a preset condition.

FIG. 25 is a schematic diagram of a structure of a communicationapparatus according to an embodiment of this application. Thecommunication apparatus 2500 may be configured to implement the methodrelated to the first relay device described in the foregoing methodembodiments. The communication apparatus 2500 may be a chip.

The communication apparatus 2500 includes one or more processors 2501.The one or more processors 2501 may support the communication apparatus2500 in implementing the communication methods in FIG. 3 to FIG. 5 . Theprocessor 2501 may be a general-purpose processor or a special-purposeprocessor. For example, the processor 2501 may be a central processingunit (CPU) or a baseband processor. The baseband processor may beconfigured to process communication data. The CPU may be configured tocontrol the communication apparatus (for example, a network device, aterminal device, or the chip), execute a software program, and processdata of the software program. The communication apparatus 2500 mayfurther include a transceiver unit 2505, configured to input (receive)and output (send) a signal.

For example, the communication apparatus 2500 may be the chip, and thetransceiver unit 2505 may be an input circuit and/or an output circuitof the chip, or the transceiver unit 2505 may be a communicationinterface of the chip. The chip may be used as a component of theterminal device, the network device, or another wireless communicationdevice.

The communication apparatus 2500 may include one or more memories 2502.The memory 2502 stores a program 2504. The program 2504 may be run bythe processor 2501 to generate instructions 2503, to enable theprocessor 2501 to perform, according to the instructions 2503, themethods described in the foregoing method embodiments. Optionally, thememory 2502 may further store data. Optionally, the processor 2501 mayfurther read the data stored in the memory 2502. The data and theprogram 2504 may be stored at a same storage address, or may be storedat different storage addresses.

The processor 2501 and the memory 2502 may be configured separately, ormay be integrated together, for example, integrated on a single board ora system on a chip (SOC).

The communication apparatus 2500 may further include the transceiverunit 2505 and an antenna 2506. The transceiver unit 2505 may be referredto as a transceiver or a transceiver circuit, and is configured toimplement a transceiver function of the communication apparatus throughthe antenna 2506.

It should be understood that the steps in the foregoing methodembodiments may be completed by using a logic circuit in a form ofhardware or instructions in a form of software in the processor 2501.The processor 2501 may be a CPU, a digital signal processor (DSP), anapplication-specific integrated circuit (ASIC), a field programmablegate array (FPGA), or another programmable logic device, for example, adiscrete gate, a transistor logic device, or a discrete hardwarecomponent.

FIG. 26 is a schematic diagram of another structure of a communicationapparatus according to an embodiment of this application. Thecommunication apparatus 2600 may be configured to implement the methodrelated to the first relay device described in the foregoing methodembodiments. The communication apparatus 2600 may be a chip.

The communication apparatus 2600 includes one or more processors 2601.The one or more processors 2601 may support the communication apparatus2600 in implementing the communication methods in FIG. 3 to FIG. 5 . Theprocessor 2601 may be a general-purpose processor or a special-purposeprocessor. For example, the processor 2601 may be a central processingunit (CPU) or a baseband processor. The baseband processor may beconfigured to process communication data. The CPU may be configured tocontrol the communication apparatus (for example, a network device, aterminal device, or the chip), execute a software program, and processdata of the software program. The communication apparatus 2600 mayfurther include a transceiver unit 2605, configured to input (receive)and output (send) a signal.

For example, the communication apparatus 2600 may be the chip, and thetransceiver unit 2605 may be an input circuit and/or an output circuitof the chip, or the transceiver unit 2605 may be a communicationinterface of the chip. The chip may be used as a component of theterminal device, the network device, or another wireless communicationdevice.

The communication apparatus 2600 may include one or more memories 2602.The memory 2602 stores a program 2604. The program 2604 may be run bythe processor 2601 to generate instructions 2603, to enable theprocessor 2601 to perform, according to the instructions 2603, themethods described in the foregoing method embodiments. Optionally, thememory 2602 may further store data. Optionally, the processor 2601 mayfurther read the data stored in the memory 2602. The data and theprogram 2604 may be stored at a same storage address, or may be storedat different storage addresses.

The processor 2601 and the memory 2602 may be configured separately, ormay be integrated together, for example, integrated on a single board ora system on a chip (SOC).

The communication apparatus 2600 may further include the transceiverunit 2605 and an antenna 2606. The transceiver unit 2605 may be referredto as a transceiver or a transceiver circuit, and is configured toimplement a transceiver function of the communication apparatus throughthe antenna 2606.

It should be understood that the steps in the foregoing methodembodiments may be completed by using a logic circuit in a form ofhardware or instructions in a form of software in the processor 2601.The processor 2601 may be a CPU, a digital signal processor (DSP), anapplication-specific integrated circuit (ASIC), a field programmablegate array (FPGA), or another programmable logic device, for example, adiscrete gate, a transistor logic device, or a discrete hardwarecomponent.

FIG. 27 is a schematic diagram of another structure of a communicationapparatus according to an embodiment of this application. Thecommunication apparatus 2700 may be configured to implement the methodrelated to the first relay device described in the foregoing methodembodiments. The communication apparatus 2700 may be a chip.

The communication apparatus 2700 includes one or more processors 2701.The one or more processors 2701 may support the communication apparatus2700 in implementing the communication methods in FIG. 3 to FIG. 5 . Theprocessor 2701 may be a general-purpose processor or a special-purposeprocessor. For example, the processor 2701 may be a central processingunit (CPU) or a baseband processor. The baseband processor may beconfigured to process communication data. The CPU may be configured tocontrol the communication apparatus (for example, a network device, aterminal device, or the chip), execute a software program, and processdata of the software program. The communication apparatus 2700 mayfurther include a transceiver unit 2705, configured to input (receive)and output (send) a signal.

For example, the communication apparatus 2700 may be the chip, and thetransceiver unit 2705 may be an input circuit and/or an output circuitof the chip, or the transceiver unit 2705 may be a communicationinterface of the chip. The chip may be used as a component of theterminal device, the network device, or another wireless communicationdevice.

The communication apparatus 2700 may include one or more memories 2702.The memory 2702 stores a program 2704. The program 2704 may be run bythe processor 2701 to generate instructions 2703, to enable theprocessor 2701 to perform, according to the instructions 2703, themethods described in the foregoing method embodiments. Optionally, thememory 2702 may further store data. Optionally, the processor 2701 mayfurther read the data stored in the memory 2702. The data and theprogram 2704 may be stored at a same storage address, or may be storedat different storage addresses.

The processor 2701 and the memory 2702 may be configured separately, ormay be integrated together, for example, integrated on a single board ora system on a chip (SOC).

The communication apparatus 2700 may further include the transceiverunit 2705 and an antenna 2706. The transceiver unit 2705 may be referredto as a transceiver or a transceiver circuit, and is configured toimplement a transceiver function of the communication apparatus throughthe antenna 2706.

It should be understood that the steps in the foregoing methodembodiments may be completed by using a logic circuit in a form ofhardware or instructions in a form of software in the processor 2701.The processor 2701 may be a CPU, a digital signal processor (DSP), anapplication-specific integrated circuit (ASIC), a field programmablegate array (FPGA), or another programmable logic device, for example, adiscrete gate, a transistor logic device, or a discrete hardwarecomponent.

An embodiment of this application further provides a chip system,including a processor, where the processor is coupled to a memory. Thememory is configured to store a program or instructions. When theprogram or the instructions is/are executed by the processor, the chipsystem is enabled to implement the method in any one of the foregoingmethod embodiments.

Optionally, there may be one or more processors in the chip system. Theprocessor may be implemented by hardware, or may be implemented bysoftware. When the processor is implemented by the hardware, theprocessor may be a logic circuit, an integrated circuit, or the like.When the processor is implemented by the software, the processor may bea general-purpose processor, and is implemented by reading software codestored in the memory.

Optionally, there may also be one or more memories in the chip system.The memory may be integrated with the processor, or may be separatedfrom the processor. This is not limited in this application. Forexample, the memory may be a non-transitory memory, for example, aread-only memory ROM. The memory and the processor may be integrated ona same chip, or may be separately configured on different chips. A typeof the memory and a manner of configuring the memory and the processorare not specifically limited in this application.

For example, the chip system may be a field programmable gate array(FPGA), an application-specific integrated circuit (ASIC), a system on achip (SoC), a central processing unit (CPU), a network processor (NP), adigital signal processor (DSP), a microcontroller unit (MCU), aprogrammable logic device (PLD), or another integrated chip.

It should be understood that the steps in the foregoing methodembodiments may be completed by using a hardware integrated logiccircuit or instructions in a software form in the processor. The stepsof the methods according to embodiments of this application may bedirectly performed and completed by a hardware processor, or may beperformed and completed by a combination of hardware and a softwaremodule in the processor.

An embodiment of this application further provides a computer-readablestorage medium. The computer storage medium stores computer-readableinstructions. When a computer reads and executes the computer-readableinstructions, the computer is enabled to perform the method in any oneof the foregoing method embodiments.

An embodiment of this application further provides a computer programproduct. When a computer reads and executes the computer programproduct, the computer is enabled to perform the method in any one of theforegoing method embodiments.

An embodiment of this application further provides a communicationsystem. The communication system includes a first network sliceselection network element, a second network slice selection networkelement, and an access management network element. Optionally, thecommunication system may further include a network repository functionnetwork element.

It should be understood that the processor in embodiments of thisapplication may be a central processing unit (CPU), or the processor maybe another general-purpose processor, a digital signal processor (DSP),an application-specific integrated circuit (ASIC), a field programmablegate array (FPGA) or another programmable logic device, a discrete gate,a transistor logic device, a discrete hardware component, or the like.The general-purpose processor may be a microprocessor, or the processormay be any conventional processor or the like.

It should be further understood that the memory in embodiments of thisapplication may be a volatile memory or a nonvolatile memory, or mayinclude a volatile memory and a nonvolatile memory. The nonvolatilememory may be a read-only memory (ROM), a programmable read-only memory(PROM), an erasable programmable read-only memory (EPROM), anelectrically erasable programmable read-only memory (EEPROM), or a flashmemory. The volatile memory may be a random access memory (RAM), used asan external cache. By way of example but not limitation, many forms ofRAMs may be used, for example, a static random access memory (SRAM), adynamic random access memory (DRAM), a synchronous dynamic random accessmemory (SDRAM), a double data rate synchronous dynamic random accessmemory (DDR SDRAM), an enhanced synchronous dynamic random access memory(ESDRAM), a synchlink dynamic random access memory (SLDRAM), and adirect rambus random access memory (DR RAM).

It should be noted that when the processor is a general-purposeprocessor, a DSP, an ASIC, an FPGA or another programmable logic device,a discrete gate, a transistor logic device, or a discrete hardwarecomponent, the memory (a storage module) is integrated into theprocessor.

It should be understood that, on the premise that no conflict occurs,embodiments described in this application and/or technical features inthe embodiments may be randomly combined with each other, and technicalsolutions obtained through combination shall also fall within theprotection scope of this application.

In the several embodiments provided in this application, it should beunderstood that the disclosed apparatus and method may be implemented inother manners. For example, the foregoing described apparatusembodiments are merely examples. For example, division into modules ismerely logical function division and there may be other division in anactual implementation.

When a method in embodiments of this application is implemented in aform of a software functional unit and sold or used as an independentproduct, the method may be stored in a computer-readable storage medium.Based on such an understanding, the technical solutions of thisapplication or some of the technical solutions may be implemented in aform of a software product. The computer software product is stored in astorage medium, and includes several instructions for instructing acomputer device (which may be a personal computer, a server, a networkdevice, or the like) to perform all or some of the steps of the methodsdescribed in embodiments of this application. The storage mediumincludes at least any medium, for example, a USB flash drive, aremovable hard disk, a read-only memory (ROM), a random access memory(RAM), a magnetic disk, an optical disc, or the like that can storeprogram code. The foregoing descriptions are merely specificimplementations of this application, but are not intended to limit theprotection scope of this application. Any variation or replacementreadily figured out by a person skilled in the art within the technicalscope disclosed in this application shall fall within the protectionscope of this application. Therefore, the protection scope of thisapplication shall be subject to the protection scope of the claims.

1. A unicast communication method, comprising: receiving, by a firstrelay device, a first message sent by a first terminal device, whereinthe first message comprises a first identifier of a second terminaldevice; and sending, by the first relay device, a second message to thesecond terminal device when a transmission quality of the first messagemeets a first preset condition, wherein the second message is forestablishing a first unicast connection, and the first unicastconnection is a unicast connection established between the firstterminal device and the second terminal device through the first relaydevice.
 2. The method according to claim 1, wherein that transmissionquality of the first message meets the first preset condition when areference signal received power (RSRP) of the first message is greaterthan or equal to a first threshold.
 3. The method according to claim 1,further comprising: receiving, by the first relay device, a thirdmessage sent by the second terminal device, wherein the third messagecomprises the first identifier of the second terminal device; andforwarding, by the first relay device, the third message to the firstterminal device when a transmission quality of the third message meets asecond preset condition.
 4. The method according to claim 3, whereinthat the transmission quality of the third message meets the secondpreset condition comprises: an RSRP of the third message is greater thanor equal to a second threshold.
 5. The method according to claim 1,wherein the method further comprises: receiving, by the first relaydevice, first indication information, wherein the first indicationinformation indicates the first relay device to change the first presetcondition and/or the second preset condition.
 6. The method according toclaim 1, wherein the first message is for requesting to establish thefirst unicast connection.
 7. The method according to claim 1 wherein thefirst message is for requesting to discover a target relay device.
 8. Anapparatus, comprising: at least one processor, and a memory storinginstructions for execution by the at least one processor; wherein, whenexecuted, the instructions cause the apparatus to perform operationscomprising: receiving a first message sent by a first terminal device,wherein the first message comprises a first identifier of a secondterminal device; and sending a second message to the second terminaldevice when a transmission quality of the first message meets a firstpreset condition, wherein the second message is for establishing a firstunicast connection, and the first unicast connection is a unicastconnection established between the first terminal device and the secondterminal device through the apparatus.
 9. The apparatus according toclaim 8, wherein that transmission quality of the first message meetsthe first preset condition when a reference signal received power (RSRP)of the first message is greater than or equal to a first threshold. 10.The apparatus according to claim 8, wherein, when executed, theinstructions cause the apparatus to perform operations comprising:receiving a third message sent by the second terminal device, whereinthe third message comprises the first identifier of the second terminaldevice; and forwarding the third message to the first terminal devicewhen a transmission quality of the third message meets a second presetcondition.
 11. The apparatus according to claim 10, wherein thattransmission quality of the third message meets the second presetcondition when an RSRP of the third message is greater than or equal toa second threshold.
 12. The apparatus according to claim 8, wherein,when executed, the instructions cause the apparatus to performoperations comprising: receiving first indication information, whereinthe first indication information indicates the apparatus to change thefirst preset condition and/or the second preset condition.
 13. Theapparatus according to claim 8, wherein the first message is forrequesting to establish the first unicast connection.
 14. The apparatusaccording to claim 8, wherein the first message is for requesting todiscover a target relay device.
 15. A non-transitory memory storagemedium comprising computer-executable instructions that, when executed,facilitate a first relay device carrying out operations comprising:receiving a first message sent by a first terminal device, wherein thefirst message comprises a first identifier of a second terminal device;and sending a second message to the second terminal device when atransmission quality of the first message meets a first presetcondition, wherein the second message is for establishing a firstunicast connection, and the first unicast connection is a unicastconnection established between the first terminal device and the secondterminal device through the first relay device.
 16. The non-transitorymemory storage medium according to claim 15, wherein that transmissionquality of the first message meets the first preset condition when areference signal received power (RSRP) of the first message is greaterthan or equal to a first threshold.
 17. The non-transitory memorystorage medium according to claim 15, wherein when the instructions areexecuted, the instructions carry out operations comprising: receiving athird message sent by the second terminal device, wherein the thirdmessage comprises the first identifier of the second terminal device;and forwarding the third message to the first terminal device when atransmission quality of the third message meets a second presetcondition.
 18. The non-transitory memory storage medium according toclaim 17, wherein that transmission quality of the third message meetsthe second preset condition when an RSRP of the third message is greaterthan or equal to a second threshold.
 19. The non-transitory memorystorage medium according to claim 15, wherein when the instructions areexecuted, the instructions carry out operations comprising: receivingfirst indication information, wherein the first indication informationindicates the first relay device to change the first preset conditionand/or the second preset condition.
 20. The non-transitory memorystorage medium according to claim 15, wherein the first message is forrequesting to establish the first unicast connection.